Hi Everyone,
 
I'm having Session handling problems.
 
I have now built a number of Beans which look after database access.  The Beans do all the database interactions within the "processRequest" public method & then there are a number of "set", "get" and "is" methods which the JSP pages use to set (via. A HREF's & FORM METHODS) and get data for display.
 
The "processRequest" public method loads up the [database] results into private class variables which are shared by all the public methods. 
 
My problem is that after the "processRequest" method is executed all sessions (Browsers ON DIFFERENT Computers) retrieve the same data from the "get" methods of the Bean.  There appears to only be one instance of a Bean at any one time & data seems to be shared accross all users.
 
With Servlets it is up to the programmer to utilise the "request.getSession(true)" method to track & control sessions.  Is this still the case with JSP/Bean programming?  If so how do you hold data (other than private class variables) for retriving by individual sessions? 
 
I think the above must be incorrect as it is only the "processRequest" public method in the Bean that has access to the "request" object (passed into processRequest as an argument).
 
This is a terrible pain in my side as I now have a site, with multiple beans, handling all database access via a singleton class & everything is working perfectly except for Session handling.  This means that right now the site is unusable.
 
I know the answer is out there somewhere :)
 
 
Derek Conniffe
 
 
 

Reply via email to