You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Zellhoefer <da...@8bit-inferno.de> on 2003/06/24 11:28:59 UTC

easy question

Hello!

I have a easy question for you:

1)I have written a class called Test, compiled it and placed it in
~/WEB-INF/classes/
2) Now I want to use objects from Test in a JSP, but if I try to use
Test Tomcat always tells me that it is not able to resolve the symbol.

What shall I do? Do I need to change the web.xml?

Thanks,

David

PS: I've restarted Tomcat 4.1.12 everytime I changed something in the
WEB-INF directory.


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


Re: easy question

Posted by David Zellhoefer <da...@8bit-inferno.de>.
Thank you all! My problem was something in between the "developer's ide 
knows all packages" and the fact that I was presuming that the JSP and 
my class are within the same package.
Thanks for the tip about the JAR, I'll use this. It's very convenient.
Cheers,

David

Holger Klawitter wrote:
> Am Dienstag, 24. Juni 2003 11:28 schrieb David Zellhoefer:
> 
>>Hello!
>>
>>I have a easy question for you:
>>
>>1)I have written a class called Test, compiled it and placed it in
>>~/WEB-INF/classes/
>>2) Now I want to use objects from Test in a JSP, but if I try to use
>>Test Tomcat always tells me that it is not able to resolve the symbol.
>>
>>What shall I do? Do I need to change the web.xml?
> 
> 
> the contents of "classes" is not part of any package, whereas your jsp page 
> is. You have to "import" your class.
> 
> Mit freundlichem Gruß / With kind regards
> 	Holger Klawitter
> --
> lists@klawitter.de
> 
> 
> ---------------------------------------------------------------------
> 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: easy question

Posted by Holger Klawitter <li...@klawitter.de>.
Am Dienstag, 24. Juni 2003 11:28 schrieb David Zellhoefer:
> Hello!
>
> I have a easy question for you:
>
> 1)I have written a class called Test, compiled it and placed it in
> ~/WEB-INF/classes/
> 2) Now I want to use objects from Test in a JSP, but if I try to use
> Test Tomcat always tells me that it is not able to resolve the symbol.
>
> What shall I do? Do I need to change the web.xml?

the contents of "classes" is not part of any package, whereas your jsp page 
is. You have to "import" your class.

Mit freundlichem Gruß / With kind regards
	Holger Klawitter
--
lists@klawitter.de


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


RE: easy question

Posted by Atreya Basu <at...@greenfieldresearch.ca>.
The easiest thing to do is the following:

Put Test into a package.  Then copy the proper package directory
structure into WEB-INF/classes.

Then add the fully qualified class-name of Test into your JSP.  This
will work. 

If you have a class that is not in a package you will have a hard time
resolving it.  
_____________________________________
Atreya Basu
Developer,
Greenfield Research Inc.
e-mail: atreya (at) greenfieldresearch (dot) ca

-----Original Message-----
From: David Zellhoefer [mailto:david@8bit-inferno.de] 
Sent: June 24, 2003 6:29 AM
To: tomcat-user@jakarta.apache.org
Subject: easy question

Hello!

I have a easy question for you:

1)I have written a class called Test, compiled it and placed it in
~/WEB-INF/classes/
2) Now I want to use objects from Test in a JSP, but if I try to use
Test Tomcat always tells me that it is not able to resolve the symbol.

What shall I do? Do I need to change the web.xml?

Thanks,

David

PS: I've restarted Tomcat 4.1.12 everytime I changed something in the
WEB-INF directory.


---------------------------------------------------------------------
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: easy question

Posted by Riaan Oberholzer <ri...@yahoo.com>.
Did you import the class in the jsp file?

At the start of the JSP file, it must be imported:

<%@ page import="Test" %>




--- David Zellhoefer <da...@8bit-inferno.de> wrote:
> Hello!
> 
> I have a easy question for you:
> 
> 1)I have written a class called Test, compiled it
> and placed it in
> ~/WEB-INF/classes/
> 2) Now I want to use objects from Test in a JSP, but
> if I try to use
> Test Tomcat always tells me that it is not able to
> resolve the symbol.
> 
> What shall I do? Do I need to change the web.xml?
> 
> Thanks,
> 
> David
> 
> PS: I've restarted Tomcat 4.1.12 everytime I changed
> something in the
> WEB-INF directory.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tomcat-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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


RE: easy question

Posted by Arnaud HERITIER <ah...@sopragroup.com>.
did you add the import statement in the jsp???

> -----Message d'origine-----
> De : David Zellhoefer [mailto:david@8bit-inferno.de]
> Envoye : mardi 24 juin 2003 11:29
> A : tomcat-user@jakarta.apache.org
> Objet : easy question
> 
> 
> Hello!
> 
> I have a easy question for you:
> 
> 1)I have written a class called Test, compiled it and placed it in
> ~/WEB-INF/classes/
> 2) Now I want to use objects from Test in a JSP, but if I try to use
> Test Tomcat always tells me that it is not able to resolve the symbol.
> 
> What shall I do? Do I need to change the web.xml?
> 
> Thanks,
> 
> David
> 
> PS: I've restarted Tomcat 4.1.12 everytime I changed something in the
> WEB-INF directory.
> 
> 
> ---------------------------------------------------------------------
> 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