Re: Session management with Struts
"Nanduri, Amarnath" wrote: > 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 search the archives for: "The Joy of File" Pete begin:vcard n:; x-mozilla-html:FALSE org:http://www.irista.com/logo/irista.gif";>Bringing Vision to Your Supply Chain adr:;; version:2.1 end:vcard
RE: Session management with Struts
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
RE: Session management with Struts
Hi, I think you want to start looking at the 'tokens' functionality that comes with struts. We did something similar in my last non-struts project and it worked very well. Andy S [EMAIL PROTECTED] on 09/05/2001 22:44:26 Please respond to [EMAIL PROTECTED] To: [EMAIL PROTECTED] cc:(bcc: Andrew Steady/Swindon01/Domino01/Kinesis) 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 The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. PricewaterhouseCoopers Kinesis Ltd
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
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