Multiple instances of an ActionForm in the same session

2002-10-28 Thread John D. Penrose
I need to support a muilti-page wizard in popup browsers, meaning multiple
browser instances sharing one session.  I can't store the ActionForm at
request scope, since it's a multi-page wizard.  It must be stored at session
scope.  Since there's multiple active browser instances, their information
would overwrite other instances data.

It seems as though Struts does not support this.  I searched FAQs and
archives, and posted to the user list but there were no replies.

Now, I'm looking into modifying the source to support this.  From my user
list email:

 I have also considered using Struts 1.1, and overriding
 RequestUtils.createActionForm(...), which is called by
 RequestProcessor.processActionForm(...), and looking for some instance id
 field for the form.  The part I haven't figured out yet is how to put that
 instance id field into the form in the first place, automatically at the
 struts level.  I'm thinking I could add code to the html:form tag to put
 the id in the form as a hidden input, but I haven't gotten that far yet.

Is this a feasible approach?  Is there a better way?

Any help will be greatly appreciated.

Regards,
John

- Original Message -
From: John D. Penrose [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 23, 2002 2:38 PM
Subject: Multiple instances of an ActionForm in the same session


 I have a requirement to support multiple browser instances for a user
 entering orders for Widgets simultaneously.The order entry form is a
 multi-page wizard that pops up in a new browser instance, under the same
 session as the original browser.

 My first approach is to define an ActionForm subclass, stored at session
 scope, so each page of the wizard can fill out a subset of the
ActionForm's
 fields.

 However, if the user clicks Order Widget in the original browser, a
third
 instance pops up, under the same session, and the two multi-page wizards
 overwrite each other's data.

 I have read the FAQ and searched the list archives for this situation, but
I
 have not found the answer.

 I have also considered using Struts 1.1, and overriding
 RequestUtils.createActionForm(...), which is called by
 RequestProcessor.processActionForm(...), and looking for some instance id
 field for the form.  The part I haven't figured out yet is how to put that
 instance id field into the form in the first place, automatically at the
 struts level.  I'm thinking I could add code to the html:form tag to put
 the id in the form as a hidden input, but I haven't gotten that far yet.

 Any help will be greatly appreciated.

 Regards,
 John
 [EMAIL PROTECTED]





--
To unsubscribe, e-mail:   mailto:struts-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org




Re: Multiple instances of an ActionForm in the same session

2002-10-28 Thread Joe Germuska
At 5:04 PM -0500 2002/10/28, John D. Penrose wrote:

I need to support a muilti-page wizard in popup browsers, meaning multiple
browser instances sharing one session.  I can't store the ActionForm at
request scope, since it's a multi-page wizard.  It must be stored at session
scope.  Since there's multiple active browser instances, their information
would overwrite other instances data.

It seems as though Struts does not support this.  I searched FAQs and
archives, and posted to the user list but there were no replies.


I'm pretty sure you could do all of this in Action logic, without 
having to change core Struts code.  You can specify a name 
attribute of html:form to indicate any bean you choose as the basis 
for resetting the state of the form's fields.

So, then, you keep all the necessary instances of this form in the 
user's session, and in the action class, you use some application 
logic to look up the right one and put a reference to it into the 
request scope under the name which your JSP is looking for it.

If you don't specify a name attribute in the html:form tag, 
Struts will consult the relevant ActionMapping, but you can override 
it easily in this fashion.

Joe


Now, I'm looking into modifying the source to support this.  From my user
list email:


 I have also considered using Struts 1.1, and overriding
 RequestUtils.createActionForm(...), which is called by
 RequestProcessor.processActionForm(...), and looking for some instance id
 field for the form.  The part I haven't figured out yet is how to put that
 instance id field into the form in the first place, automatically at the
 struts level.  I'm thinking I could add code to the html:form tag to put
 the id in the form as a hidden input, but I haven't gotten that far yet.


Is this a feasible approach?  Is there a better way?

Any help will be greatly appreciated.

Regards,
John

- Original Message -
From: John D. Penrose [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, October 23, 2002 2:38 PM
Subject: Multiple instances of an ActionForm in the same session



 I have a requirement to support multiple browser instances for a user
 entering orders for Widgets simultaneously.The order entry form is a
 multi-page wizard that pops up in a new browser instance, under the same
 session as the original browser.

 My first approach is to define an ActionForm subclass, stored at session
 scope, so each page of the wizard can fill out a subset of the

ActionForm's

 fields.

 However, if the user clicks Order Widget in the original browser, a

third

 instance pops up, under the same session, and the two multi-page wizards
 overwrite each other's data.

 I have read the FAQ and searched the list archives for this situation, but

I

 have not found the answer.

 I have also considered using Struts 1.1, and overriding
 RequestUtils.createActionForm(...), which is called by
 RequestProcessor.processActionForm(...), and looking for some instance id
 field for the form.  The part I haven't figured out yet is how to put that
 instance id field into the form in the first place, automatically at the
 struts level.  I'm thinking I could add code to the html:form tag to put
 the id in the form as a hidden input, but I haven't gotten that far yet.

 Any help will be greatly appreciated.

 Regards,
 John
 [EMAIL PROTECTED]






--
To unsubscribe, e-mail:   mailto:struts-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org



--
--
* Joe Germuska{ [EMAIL PROTECTED] }
It's pitiful, sometimes, if they've got it bad. Their eyes get 
glazed, they go white, their hands tremble As I watch them I 
often feel that a dope peddler is a gentleman compared with the man 
who sells records.
	--Sam Goody, 1956

--
To unsubscribe, e-mail:   mailto:struts-dev-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-dev-help;jakarta.apache.org