This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple jsp:useBean question

 
Amarjyoti Das
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When I hit the submit button in the following page, will another mybean be created with session scope? If so, how can I overcome that?
Code for test.jsp page
======================

Thank you,
Amar
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amar-
if you have this declaration in your test.jsp:
<jsp:useBean id="mybean" scope="session" class="com.psgs.mybean" />
the container will first look for for a bean with the same id in the scope you've specified. If it finds it, then it is reused. If it doesn't find it, then a new instance of mybean is created.
HTH
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic