RE: Passing an ArrayList

2004-02-09 Thread Andrew Hill
+1


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.


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:[EMAIL PROTECTED]
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:[EMAIL PROTECTED]
>Sent: Monday, February 09, 2004 1:20 PM
>To: [EMAIL PROTECTED]
>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" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >To: "Struts - List" <[EMAIL PROTECTED]>
> >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: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>_
>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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Passing an ArrayList

2004-02-09 Thread Michael McGrady
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:[EMAIL PROTECTED]
Sent: Monday, February 09, 2004 1:20 PM
To: [EMAIL PROTECTED]
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" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts - List" <[EMAIL PROTECTED]>
>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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
_
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Passing an ArrayList

2004-02-09 Thread Brian Ivey
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:[EMAIL PROTECTED]
Sent: Monday, February 09, 2004 1:20 PM
To: [EMAIL PROTECTED]
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" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts - List" <[EMAIL PROTECTED]>
>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: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

_
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Passing an ArrayList

2004-02-09 Thread Ben Anderson
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" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts - List" <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Passing an ArrayList

2004-02-09 Thread Paul McCulloch
You really want to stick the data in session scope - that is what it is for.

Request scope really won't help - anything in there will have gone out of
scope immediately after the page is rendered for the user.

I'd *seriously* question why you aren't supposed to be using session scope.
Can you give us an idea why you are being asked to avoid it's use?

If you can't use session scope then I think the only place you can store the
data is the rendered html. You could use hidden input fields to store the
data - these values will then be provided to the action then next time it is
called. I think you should look at indexed properties - I haven't used them
myself.

Paul

> -Original Message-
> From: Brian Ivey [mailto:[EMAIL PROTECTED]
> Sent: 09 February 2004 17:44
> To: Struts - List
> Subject: Passing an ArrayList
> 
> 
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]