File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes problem using my class in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "problem using my class in JSP" Watch "problem using my class in JSP" New topic

problem using my class in JSP

Orli Klinger

Joined: Jun 02, 2004
Posts: 2
Hello everyone,

I'm having trouble using a class I defined in a JSP.
I placed my class in:
C:\Program Files\jakarta-tomcat-4.1.30\webapps\servlets\WEB-INF\classes
and I was able to compile it in Eclipse and use it in servlets.

In the JSP I write:

And I get this error message:

I am able to use classes like Date by the way...
What am I doing wrong?
Any help would be greatly appreciated.

William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12675
Sounds like the common problem that happens when you use a class not declared in a package and/or not imported correctly.
Put your class in a package and recompile - be sure to locate the class file under WEB-INF/classes using the package name.
In your JSP you must import the package or use the fully qualified class name.

Java Resources at
Orli Klinger

Joined: Jun 02, 2004
Posts: 2
Thank you!
It works now
All I had to do was put it in a package
I agree. Here's the link:
subject: problem using my class in JSP
Similar Threads
Jsp bean error
error while running JSTL
unnable to create object of a class..
JSP error using tomcat