jsp:useBean question
843835Jun 19 2002 — edited Jun 19 2002Hi,
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