Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jsp:useBean question

843835Jun 19 2002 — edited Jun 19 2002
Hi,

I know this issue has probably bean (!) addressed here before but I just wanted clarification..

I have a JSP page which uses the jsp:useBean tag with scope="session" to call a normal java bean which populates some of its properties from a database. When the bean is called it requests a database connection from a pool and returns the connection to the pool when its finished with it. The JSP page then calls the bean get() methods to populate the HTML form fields.

My point is that in the browser window (IE) with the JSP showing if I hold down F5 and repeatedly request the page multiple instances of the bean seem to be created (the database connection log shows this - multiple getConnection() and releaseConnections() )

I thought the point of scope=session was that one instance would be created and then referred back to should the page be rerequested? Should I be storing a reference to the bean in the session object? if so whats the point of scope="session"? any thoughts welcome..

Apologies for the long note!

thanks in advance

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 17 2002
Added on Jun 19 2002
4 comments
89 views