Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Basic useBean question

 
Billy Hause
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I put this at the top of my JSP
<jsp:useBean id="userInfo" scope="session" type="hause.user_management.User"/>
Now I get the following error:
javax.servlet.ServletException: bean userInfo not found within scope
What causes this error? (This is the first time I've tried to use the useBean tag in my jsps.)
Thanks,
Billy Hause
 
Jignesh Malavia
Author
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Replace the type attribute with the class attribute as
<jsp:useBean id="userInfo" scope="session" class="hause.user_management.User"/>
The class attribute instructs the JSP engine to create a new instance of the specified class if an existing one is not found.
For a detailed explanation on the different attributes of the useBean tag, have a look at this chapter.
-j
 
Billy Hause
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Much!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic