• Post Reply Bookmark Topic Watch Topic
  • New Topic

where do I put my classes?

 
Pete Albano
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
chiu pong
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You MUST put your beans in a package. If you don't, your JSP will fail to compile.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • 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
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!