• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cannot find classes from jsp

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The class must be in a package other than the default.
 
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Hot dog! An advertiser loves us THIS much:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic