• 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

where do I put my classes?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Where do I put my JavaBeans so that Tomcat will be able to locate them? I keep getting class not found errors. I tried putting them in WEB-INF but no go. I have an example jsp that works fine - it's classes are in a specific directory in my c drive. I experimented with transporting the example's html and jsp pages to my own directory under the webapps directory in tomcat and now it can't find the specific beans it needs either. How do you set things up so that JSP can find Javabeans or any classes that you create?
Thanks in advance for the help,
Pete
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you should have a 'classes' folder inside the WEB-INF and keep the beans in.
But you should notice that is there any package inside your bean.
eg. if your bean file have the following code at the top:

Then you should have a 'support' folder inside the 'classes' folder.
Hope this help.
ypc
 
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You MUST put your beans in a package. If you don't, your JSP will fail to compile.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For a full explanation of where to put class and jar files, look at the documentation that Tomcat puts online. Look for the "Class Loader How-To" from the /tomcat-docs/index.html page.
Bill
 
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, if you put your classes under the WEB-INF/classes folder, they're automatically added to the classpath by the container.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic