File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot find classes from jsp

 
Monica Moncho
Ranch Hand
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class must be in a package other than the default.
 
Ramaswamy Srinivasan
Ranch Hand
Posts: 295
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 31
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic