File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Cannot find classes from jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Cannot find classes from jsp" Watch "Cannot find classes from jsp" New topic

Cannot find classes from jsp

Monica Moncho
Ranch Hand

Joined: Dec 01, 2004
Posts: 31

I created a jsp which uses some classes I created too, but when I try to run it Tomcat says it cannot find them. This is the structure I have:

tomcat\webapps\mydirectory\jsp --> I have the jsp here

tomcat\webapps\mydirectory\WEB-INF\classes --> I added the .class here

Do I need to change any files to let tomcat know where the classes are?

Sorry, I have so many questions.

thanks again
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63868

The class must be in a package other than the default.

[Asking smart questions] [About Bear] [Books by Bear]
Ramaswamy Srinivasan
Ranch Hand

Joined: Aug 31, 2004
Posts: 295
Hi Monica,

You have your classes in web-inf\classes right?

Do this, try creating the directory as something like this.



Put your classes inside the utils folder, in the structure.

And try importing the classes in the JSP.
This should be like org.monica.utils.YourClassName

Hope this works fine.

Monica Moncho
Ranch Hand

Joined: Dec 01, 2004
Posts: 31
Yes, I'm past that error. Now I have another one that I'll try on my own first.

thanks again!
I agree. Here's the link:
subject: Cannot find classes from jsp
It's not a secret anymore!