• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem using my class in JSP

 
Orli Klinger
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Bill
 
Orli Klinger
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you!
It works now
All I had to do was put it in a package
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic