You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Frank Garber <ga...@yahoo.com> on 2003/04/04 22:06:22 UTC

Not seeing new classes

I'm playing with the Tomcat example jsp files, specifically the date.jsp file.

I can add a statement like:  <%= new java.util.Date() %> <br />
to kick out the current date as a string, but when I try to access a java class
I've written, I get a 'cannot resolve symbol'.  The error happens as the jsp is
being compiled.

Here's the offending statement:
<%= Yada.getString() %> <br />

Here's the class definition:
public class Yada {
	public static String getString() {
		return "Hello from Yada.getString()";
	}
}

The Yada.java and Yada.class file lives in the WEB-INF\classes directory.

The WEB-INF\classes directory is in the classpath as per the screen dump I'm
getting.

Frank

=====
__________________________________________________

My full time permanent email address is always: garberfc@coolsite.net

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Not seeing new classes

Posted by Frank Garber <ga...@yahoo.com>.
Your a live saver!  That did it!!  Just moving it into the util package solved
the problem!!!!

THanks....
--- Jan Behrens <ja...@diekleinedomain.de> wrote:
> Hi Frank. just another thought...
> 
> do the following:
> 
> your class Yada:
> 
> package myYada;
> 
> public class Yada {
> 	public static String getString() {
>  		return "Hello from Yada.getString()";
>  	}
> }
> 
> store & compile that in:
> 
> WEB-INF\classes\myYada\
> 
> add the following to your date.jsp instead of <%@ page session="false"%>
> right
> at the top:
> 
> <%@page contentType="text/html"
> 	session="false"
>       import="myYada.*"%>
> 
> and reload the examples webapp....
> 
> HTH jan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


=====
__________________________________________________

My full time permanent email address is always: garberfc@coolsite.net

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Not seeing new classes

Posted by Jan Behrens <ja...@diekleinedomain.de>.
Hi Frank. just another thought...

do the following:

your class Yada:

package myYada;

public class Yada {
	public static String getString() {
 		return "Hello from Yada.getString()";
 	}
}

store & compile that in:

WEB-INF\classes\myYada\

add the following to your date.jsp instead of <%@ page session="false"%> right
at the top:

<%@page contentType="text/html"
	session="false"
      import="myYada.*"%>

and reload the examples webapp....

HTH jan


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Not seeing new classes

Posted by Vladimer Shioshvili <vs...@qrc.com>.
Frank,

you have to import the java class that you wrote  in jsp code even if the 
class is in the classes folder of the same context...






At 03:24 PM 4/4/2003, you wrote:
>Brian,
>
>Thanks for the reply.
>
>No, I didn't have an import because I'm using the default package (that is no
>package statement).
>
>I did add your import statement below, minus the innovtech.util.*, and it had
>no affect.
>
>If you have any other thoughts, please, please let me know.  I've been
>struggling with this for awhile...
>
>Thanks,
>
>Frank
>--- Brian Menke <br...@innovtech.com> wrote:
> > Does your JSP page include the right "import" declaration, something like
> > this:
> >
> > <%@ page contentType="text/html; charset=iso-8859-1" language="java"
> > import="java.sql.*,innovtech.util.*"%>
> >
> > Note the import attributte.
> >
> > -Brian
> >
> >
> > -----Original Message-----
> > From: Jan Behrens [mailto:jan@diekleinedomain.de]
> > Sent: Friday, April 04, 2003 12:09 PM
> > To: Tomcat Users List; garberfc@coolsite.net
> > Subject: RE: Not seeing new classes
> >
> >
> > > -----Original Message-----
> > > From: Frank Garber [mailto:garberfc@yahoo.com]
> > > Sent: Friday, April 04, 2003 10:06 PM
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Not seeing new classes
> > >
> > >
> > > I'm playing with the Tomcat example jsp files, specifically the
> > > date.jsp file.
> > >
> > > I can add a statement like:  <%= new java.util.Date() %> <br />
> > > to kick out the current date as a string, but when I try to access
> > > a java class
> > > I've written, I get a 'cannot resolve symbol'.  The error happens
> > > as the jsp is
> > > being compiled.
> > >
> > > Here's the offending statement:
> > > <%= Yada.getString() %> <br />
> > >
> > > Here's the class definition:
> > > public class Yada {
> > >     public static String getString() {
> > >             return "Hello from Yada.getString()";
> > >     }
> > > }
> > >
> > > The Yada.java and Yada.class file lives in the WEB-INF\classes directory.
> > >
> > > The WEB-INF\classes directory is in the classpath as per the screen dump
> > I'm
> > > getting.
> > >
> > > Frank
> > >
> > > =====
> >
> > Hi Frank,
> >
> > just asking a maybe stupid question... but have you reloaded the examples
> > webapp through the webapp-manager?
> >
> > regards, Jan
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
>
>=====
>__________________________________________________
>
>My full time permanent email address is always: garberfc@coolsite.net
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Tax Center - File online, calculators, forms, and more
>http://tax.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org

________________
Vladimer Shioshvili

QRC Division of Macro International Inc.
7315 Wisconsin Avenue, Suite 400W
Bethesda, MD 20814

Phone: (301) 657 3077 ext. 155 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Not seeing new classes

Posted by Frank Garber <ga...@yahoo.com>.
Brian,

Thanks for the reply.

No, I didn't have an import because I'm using the default package (that is no
package statement).  

I did add your import statement below, minus the innovtech.util.*, and it had
no affect.

If you have any other thoughts, please, please let me know.  I've been
struggling with this for awhile...

Thanks,

Frank
--- Brian Menke <br...@innovtech.com> wrote:
> Does your JSP page include the right "import" declaration, something like
> this:
> 
> <%@ page contentType="text/html; charset=iso-8859-1" language="java"
> import="java.sql.*,innovtech.util.*"%>
> 
> Note the import attributte.
> 
> -Brian
> 
> 
> -----Original Message-----
> From: Jan Behrens [mailto:jan@diekleinedomain.de]
> Sent: Friday, April 04, 2003 12:09 PM
> To: Tomcat Users List; garberfc@coolsite.net
> Subject: RE: Not seeing new classes
> 
> 
> > -----Original Message-----
> > From: Frank Garber [mailto:garberfc@yahoo.com]
> > Sent: Friday, April 04, 2003 10:06 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Not seeing new classes
> >
> >
> > I'm playing with the Tomcat example jsp files, specifically the
> > date.jsp file.
> >
> > I can add a statement like:  <%= new java.util.Date() %> <br />
> > to kick out the current date as a string, but when I try to access
> > a java class
> > I've written, I get a 'cannot resolve symbol'.  The error happens
> > as the jsp is
> > being compiled.
> >
> > Here's the offending statement:
> > <%= Yada.getString() %> <br />
> >
> > Here's the class definition:
> > public class Yada {
> > 	public static String getString() {
> > 		return "Hello from Yada.getString()";
> > 	}
> > }
> >
> > The Yada.java and Yada.class file lives in the WEB-INF\classes directory.
> >
> > The WEB-INF\classes directory is in the classpath as per the screen dump
> I'm
> > getting.
> >
> > Frank
> >
> > =====
> 
> Hi Frank,
> 
> just asking a maybe stupid question... but have you reloaded the examples
> webapp through the webapp-manager?
> 
> regards, Jan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


=====
__________________________________________________

My full time permanent email address is always: garberfc@coolsite.net

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Not seeing new classes

Posted by Brian Menke <br...@innovtech.com>.
Does your JSP page include the right "import" declaration, something like
this:

<%@ page contentType="text/html; charset=iso-8859-1" language="java"
import="java.sql.*,innovtech.util.*"%>

Note the import attributte.

-Brian


-----Original Message-----
From: Jan Behrens [mailto:jan@diekleinedomain.de]
Sent: Friday, April 04, 2003 12:09 PM
To: Tomcat Users List; garberfc@coolsite.net
Subject: RE: Not seeing new classes


> -----Original Message-----
> From: Frank Garber [mailto:garberfc@yahoo.com]
> Sent: Friday, April 04, 2003 10:06 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Not seeing new classes
>
>
> I'm playing with the Tomcat example jsp files, specifically the
> date.jsp file.
>
> I can add a statement like:  <%= new java.util.Date() %> <br />
> to kick out the current date as a string, but when I try to access
> a java class
> I've written, I get a 'cannot resolve symbol'.  The error happens
> as the jsp is
> being compiled.
>
> Here's the offending statement:
> <%= Yada.getString() %> <br />
>
> Here's the class definition:
> public class Yada {
> 	public static String getString() {
> 		return "Hello from Yada.getString()";
> 	}
> }
>
> The Yada.java and Yada.class file lives in the WEB-INF\classes directory.
>
> The WEB-INF\classes directory is in the classpath as per the screen dump
I'm
> getting.
>
> Frank
>
> =====

Hi Frank,

just asking a maybe stupid question... but have you reloaded the examples
webapp through the webapp-manager?

regards, Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Not seeing new classes

Posted by Jan Behrens <ja...@diekleinedomain.de>.
Ok, just checking the sort of smallest possible prob... I assume that the
amount of code you have written is below a 100 lines so how about you post
your source here. I guess you are right and it is just a typo or something
like that. BTW, as Bryan mentioned, have you imported the class correctly?

Jan

> -----Original Message-----
> From: Frank Garber [mailto:garberfc@yahoo.com]
> Sent: Friday, April 04, 2003 10:21 PM
> To: Tomcat Users List
> Subject: RE: Not seeing new classes
>
>
> Yes, I did a 'Reload' and a Stop/Start but neither helped.
>
> This seems like a no brainer but the heck if I can get it to work.
> Can you try
> doing the same on your sytem?
>
> Thanks,
>
> Frank
>
> --- Jan Behrens <ja...@diekleinedomain.de> wrote:
> > > -----Original Message-----
> > > From: Frank Garber [mailto:garberfc@yahoo.com]
> > > Sent: Friday, April 04, 2003 10:06 PM
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Not seeing new classes
> > >
> > >
> > > I'm playing with the Tomcat example jsp files, specifically the
> > > date.jsp file.
> > >
> > > I can add a statement like:  <%= new java.util.Date() %> <br />
> > > to kick out the current date as a string, but when I try to access
> > > a java class
> > > I've written, I get a 'cannot resolve symbol'.  The error happens
> > > as the jsp is
> > > being compiled.
> > >
> > > Here's the offending statement:
> > > <%= Yada.getString() %> <br />
> > >
> > > Here's the class definition:
> > > public class Yada {
> > > 	public static String getString() {
> > > 		return "Hello from Yada.getString()";
> > > 	}
> > > }
> > >
> > > The Yada.java and Yada.class file lives in the WEB-INF\classes
> directory.
> > >
> > > The WEB-INF\classes directory is in the classpath as per the screen dump
> > I'm
> > > getting.
> > >
> > > Frank
> > >
> > > =====
> >
> > Hi Frank,
> >
> > just asking a maybe stupid question... but have you reloaded the examples
> > webapp through the webapp-manager?
> >
> > regards, Jan
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> >
>
>
> =====
> __________________________________________________
>
> My full time permanent email address is always: garberfc@coolsite.net
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - File online, calculators, forms, and more
> http://tax.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Not seeing new classes

Posted by Frank Garber <ga...@yahoo.com>.
Yes, I did a 'Reload' and a Stop/Start but neither helped.

This seems like a no brainer but the heck if I can get it to work.  Can you try
doing the same on your sytem?

Thanks,

Frank

--- Jan Behrens <ja...@diekleinedomain.de> wrote:
> > -----Original Message-----
> > From: Frank Garber [mailto:garberfc@yahoo.com]
> > Sent: Friday, April 04, 2003 10:06 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Not seeing new classes
> >
> >
> > I'm playing with the Tomcat example jsp files, specifically the
> > date.jsp file.
> >
> > I can add a statement like:  <%= new java.util.Date() %> <br />
> > to kick out the current date as a string, but when I try to access
> > a java class
> > I've written, I get a 'cannot resolve symbol'.  The error happens
> > as the jsp is
> > being compiled.
> >
> > Here's the offending statement:
> > <%= Yada.getString() %> <br />
> >
> > Here's the class definition:
> > public class Yada {
> > 	public static String getString() {
> > 		return "Hello from Yada.getString()";
> > 	}
> > }
> >
> > The Yada.java and Yada.class file lives in the WEB-INF\classes directory.
> >
> > The WEB-INF\classes directory is in the classpath as per the screen dump
> I'm
> > getting.
> >
> > Frank
> >
> > =====
> 
> Hi Frank,
> 
> just asking a maybe stupid question... but have you reloaded the examples
> webapp through the webapp-manager?
> 
> regards, Jan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 


=====
__________________________________________________

My full time permanent email address is always: garberfc@coolsite.net

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Not seeing new classes

Posted by Jan Behrens <ja...@diekleinedomain.de>.
> -----Original Message-----
> From: Frank Garber [mailto:garberfc@yahoo.com]
> Sent: Friday, April 04, 2003 10:06 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Not seeing new classes
>
>
> I'm playing with the Tomcat example jsp files, specifically the
> date.jsp file.
>
> I can add a statement like:  <%= new java.util.Date() %> <br />
> to kick out the current date as a string, but when I try to access
> a java class
> I've written, I get a 'cannot resolve symbol'.  The error happens
> as the jsp is
> being compiled.
>
> Here's the offending statement:
> <%= Yada.getString() %> <br />
>
> Here's the class definition:
> public class Yada {
> 	public static String getString() {
> 		return "Hello from Yada.getString()";
> 	}
> }
>
> The Yada.java and Yada.class file lives in the WEB-INF\classes directory.
>
> The WEB-INF\classes directory is in the classpath as per the screen dump I'm
> getting.
>
> Frank
>
> =====

Hi Frank,

just asking a maybe stupid question... but have you reloaded the examples
webapp through the webapp-manager?

regards, Jan


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org