• Post Reply Bookmark Topic Watch Topic
  • New Topic

Trying to follow this tutorial  RSS feed

 
Patrick Noah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to follow this tutorial http://www.jsptut.com/Forms.jsp using jsp on apache tomcat. I have two questions:
1.<jsp:useBean id="user"<----why user, is it just the package name?
2. Where does UserData.class go?
I put my jsp in apache-tomcat-5.5.34\webapps\emailForm
 
Yatish Sonkeshariya
Greenhorn
Posts: 16
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Patrick,
1.In <jsp:useBean id="user", user is only name of beanInstance, you can use any other name.It doesnt relate to package-name.
2. UserData.class should be placed in classpath(WEB-INF/classes/user/UserData.class).
 
Patrick Noah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yatish Sonkeshariya wrote:Hello Patrick,
1.In <jsp:useBean id="user", user is only name of beanInstance, you can use any other name.It doesnt relate to package-name.
2. UserData.class should be placed in classpath(WEB-INF/classes/user/UserData.class).


Thanks for replying. What is beanInstance?
Also, I put UserData.class in apache-tomcat-5.5.34\webapps\emailForm\WEB-INF\classes and I get an error.
 
Yatish Sonkeshariya
Greenhorn
Posts: 16
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
beanInstance is the instance name of a particualr class, using which you can access its method just like you create instance progamatically,
ex- ClassName clsName = new ClassName();
It could be any name.
Can you post the error which you got?
 
Patrick Noah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yatish Sonkeshariya wrote:beanInstance is the instance name of a particualr class, using which you can access its method just like you create instance progamatically,
ex- ClassName clsName = new ClassName();
It could be any name.
Can you post the error which you got?


description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: /SaveName.jsp(1,1) The value for the useBean class attribute user.UserData is invalid.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a bean need UserData in a package named user? Id the the class file in the proper location? Please take more time with your posts to describe thew problem and what you have done more precisely.
 
Patrick Noah
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Do you have a bean need UserData in a package named user? Id the the class file in the proper location? Please take more time with your posts to describe thew problem and what you have done more precisely.


I have a class named UserData in a package named user. The class file is in apache-tomcat-5.5.34/webapps/emailForm/WEB-INF/classes.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class files need to be in a folder structure that matches the package. If it's in package user, the class must be in a folder user.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!