struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Bush <ekb...@swbell.net>
Subject Re: Multiple forms in session [WAS: RE: how to send actionForm from one action to another action]
Date Wed, 18 Dec 2002 04:11:04 GMT
Andrew Hill wrote:

>One thing Ive never understood about forms in session scope, is how does
>struts deal with the situation where there are two concurrent requests in
>the same session both of which are for the same action (and form type)?
>
They would use the same form, I'd think.  If you needed multiple 
different copies you'd have to literally have different forms :-(

>As far as I can make out however, the key for a form is fixed without a way
>to differentiate different instances of the same form type. Is this actually
>the case or havent I read the code closely enough?
>
I haven't noticed it if it's there either.  I was just looking at places 
where forms are created and placed into scope because of this thread. 
 It's all quite straight-forward.  You could easily trample on your form 
if you're not careful.  Yet another reason to use request scoped forms.

><example>
>You have a page: editWotsits.jsp that uses the WotsitActionForm and submits
>to WotsitAction. The requirement is that the wotsit pages open in new
>windows (ie: <a target="_new"...) or frames, such that the user can be in
>the process of editing multiple wotsits at any given time. Due to some other
>requirements (fancy workflow perhaps?) the request scope isnt an option and
>these WotsitActionForms all need to be in session scope.
></example>
>
They'd get trampled :-(  In fact, there's really not a good solution 
that comes to mind.  The only single thing I see that we can do to make 
using session-based forms more safe is to add the module name to the key 
we use to place the forms into scope.  I'm going to go look for that bug 
now - nearly certain it's there.

>-----Original Message-----
>From: Eddie Bush [mailto:ekbush@swbell.net]
>Sent: Wednesday, December 18, 2002 11:34
>To: Struts Users Mailing List
>Subject: Re: how to send actionForm from one action to another action
>
>
>It's actually a combination of the module name and the form name.  Now
>that we have modules, a strategy has to be used which allows each module
>to have forms of the same name.  The source code would definitely be the
>place to see exactly how the name is arrived at - I'd tell you, but I
>haven't looked at it since it was updated.
>
-- 
Eddie Bush




--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message