In that case i would advise you to maintain a Hashmap/Hashtable of form
objects wrapped inside an Global Action form (session scope). Every time a
user opens a new browser window, i am sure that a unique id can be generated
for the new window ( i have seen a posting on this list a month back where
somebody has explained that using javascript we can generate a unique id for
every new web browser that was opened by the user). Store this id in a
hidden name=value pair. Check the mail archives as to how to do this.
Over-ride your ActionServlet service() method where you initially check the
id of the browser window. (btw the form objects wrapped inside the
GlobalActionForm object will be mapped to these id's.) . When the
corresponding form object is found, then you populate the data in that form
object. If no form object is found, then create a new form object and
populate the data in that form object (using reflection). Struts has
libraries to do this. This is a complicated way of doing it, but the best
that could pop out of my brain this time...(morning blues. I could use some
caffeine). 


cheers,
Amar..

-----Original Message-----
From: TJM Todd McGregor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 5:44 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Session management with Struts


But that's exactly my problem. I have forms that may span multiple pages and
the ActionForm needs to be available across multiple requests. Any ideas????

-----Original Message-----
From: Nanduri, Amarnath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 1:53 PM
To: '[EMAIL PROTECTED]'
Subject: RE: Session management with Struts


Keep the ActionForms in 'request' scope. Then each page will have its own
ActionForm. The problme occurs when you want to store these forms in session
scope. 

cheers,
Amar..

-----Original Message-----
From: TJM Todd McGregor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 09, 2001 4:49 PM
To: [EMAIL PROTECTED]
Subject: Session management with Struts


I have a requirement that my application be able to allow multiple browser
windows, sharing the same HttpSession, to access two separate instances of a
business process simultaneously. For example, if I have a form that allows a
user to change their address information my application must allow them to
have two address forms open in separate browser windows using the same
HttpSession. To make a long story short, can Struts accommodate multiple
instances of an ActionForm in the same session? Any general comments on how
Struts does session management would also be welcome.

Thanks in advance for your response,

Todd McGregor

Reply via email to