struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <andrew.david.h...@gridnode.com>
Subject RE: Passing an ArrayList
Date Tue, 10 Feb 2004 04:00:26 GMT
+1

<snip>
I'm betting that this could be
resolved by stashing the ArrayList into the request as an attribute or
something similar, but would like some commentary on this issue.
</snip>

Dont take that bet. You will lose. Once the response is written out to the
browser its gone. Dead. Extinct. Nailed to its perch and pining for the
fjiords. And any attributes and parameters it had are gone too.

You should to put it in the session. This is what the session is there for.
No session. No store. End of story. (ok you could put it in the db (ok) or
servlet context (dont), but... have fun managing it. ;-> ).

If you really must share the session with other users, you would need to
store it in the session under a unique id and have that unique id written to
the html and submitted back in a hidden field so you can find it again!
(That technique incedentally is also good if you need to support multiple
browser windows for the same user too - something thet doesnt work too well
with a constant session key.) Dont forget to clean it up (in session or db
or wherever) after you have finished with it.

Can you explain why you have multiple users with the same sessionId? That
seems rather odd.



-----Original Message-----
From: Michael McGrady [mailto:mike@michaelmcgrady.com]
Sent: Tuesday, 10 February 2004 04:06
To: Struts Users Mailing List
Subject: RE: Passing an ArrayList


You have to store the information somewhere.  So, choose your poison and
store it.  Store the object in a database, if you like.

At 10:57 AM 2/9/2004, you wrote:
>This application will be hosted within an enterprise portal.  Because many
>users will be sharing the same session I am prevented from using the
session
>object.
>
>-----Original Message-----
>From: Ben Anderson [mailto:stuts_andersonbd1@hotmail.com]
>Sent: Monday, February 09, 2004 1:20 PM
>To: struts-user@jakarta.apache.org
>Subject: RE: Passing an ArrayList
>
>
> >project this application is for mandates only request scope be used
>Can I ask why?  It would make things much easier to set the ArrayList in
>session scope.
>
>However, I guess you can do this using struts ActionForms.  You'll just
need
>to make sure that every page you are navigating to includes your ArrayList
>in it its entirity (it can be hidden).  As soon as you navigate away from
>one of these pages, then all your info will be lost.
>
>-Ben
>
>
> >From: "Brian Ivey" <cbivey@comcast.net>
> >Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> >To: "Struts - List" <struts-user@jakarta.apache.org>
> >Subject: Passing an ArrayList
> >Date: Mon, 9 Feb 2004 12:44:08 -0500
> >
> >I'm working on an application that prompts a user to enter data into 4
text
> >fields.  The user then clicks on a button to submit these to an Action.
> >These 4 values are used to create an object that is added to an
ArrayList.
> >The page used for data entry is refreshed with the just entered values
> >appearing as a row in a table.  The user may do this as many times as
they
> >wish.
> >
> >My problem is that the ArrayList is recreated every time the Action is
> >called.  I understand that this a characteristic of the transient nature
of
> >Actions.  Can anyone make any recommendations on possible ways to
preserve
> >this ArrayList between calls to the Action.  I'm betting that this could
be
> >resolved by stashing the ArrayList into the request as an attribute or
> >something similar, but would like some commentary on this issue.  BTW,
the
> >project this application is for mandates only request scope be used.
> >
> >Thanks,
> >Brian Ivey
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>_________________________________________________________________
>Let the advanced features & services of MSN Internet Software maximize your
>online time. http://click.atdmt.com/AVE/go/onm00200363ave/direct/01/
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org



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



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


Mime
View raw message