• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

where i need to place my java bean file in the tomcat

 
albert sie
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to create a bean file but when i run the jsp page it's come out "unable to compile class for jsp"
i place my class file under the C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\ROOT\WEB-INF\classes which my page is put inside the webapps\ROOT.

some one can give me the solution in this manner

thankyou...

best regards,

albert
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you read the JSP FAQ entries on this issue?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the directory structure of a webapp is defined by the servlet spec and is not Tomcat specific, I'm going to move this to the Servlets forum.

As Bear has said, there is some material in the JSP FAQ that will help you with this. In particular, see:
http://faq.javaranch.com/view?PackageYourBeans
 
Sunil Vasudevan
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which version of Tomcat are you using. I had faced a similar issue with Tomcat 5.x.

If you are creating a bean with default package, Tomcat will not identify this bean class. Define a package for the bean class.

Example:
package foo;

public class UserBean
{
// Your private attributes and getter/setters
}

I am not sure from which version onwards Tomcat started having this restriction. Seems it was from 4.x onwards, if I am not mistaken.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic