Meaningless Drivel is fun!*
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
Author

Cannot find classes from jsp

Monica Moncho
Ranch Hand

Joined: Dec 01, 2004
Posts: 31
hi,

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
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

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


[Asking smart questions] [Bear's FrontMan] [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.

Say,

web-inf\classes\org\monica\utils

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.

Cheers,
Swamy
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!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Cannot find classes from jsp
 
Similar Threads
JSP doesn't work in Linux server.
where do i put the bean?
JSP's and class files.....
simple JSP and JavaBean, error 500
question about JSP - Tomcat