This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes Simple jsp:useBean question Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Simple jsp:useBean question" Watch "Simple jsp:useBean question" New topic
Author

Simple jsp:useBean question

Amarjyoti Das
Greenhorn

Joined: Mar 18, 2002
Posts: 16
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

Joined: Nov 27, 2001
Posts: 1561
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


I'm not going to be a Rock Star. I'm going to be a LEGEND! --Freddie Mercury
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Simple jsp:useBean question
 
Similar Threads
<jsp:getProperty> returns nothing
reagarding jsp problem
error occuring while use jsp
How to create scrolling text?
jsp:getProperty gives null