Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [S2] Collecting data from few pages

Laurie Harper

2007-02-12

Replies:

There are basically two options: retain the data from each page on the
server side, or maintain it client-side as part of each request/response.

For the first option, you can use a single form bean to aggregate the
data from all the pages in your wizard and place it in session scope.
You could also use some other strategy to retain the data between
requests (e.g. storing it in your database as you collect it), but
simply placing the form bean into session scope is probably the most
straight forward way to go.

For the second option, you would include hidden form fields on page2 for
every item of data from page1; hidden fields on page3 for the data from
pages 1 and 2, etc.

Either approach (or some variant) will work. Which to choose depends on
what constraints you have on your application (are you OK with using
session-based storage? do you have a large amount and/or frequently
changing set of data to collect? etc.)

L.

puchacz wrote:
> They could... I am searching right now idea how to do this, So I am open for
> everything!
>
>
> Martin Gainty wrote:
>> are the forms toy are using ActionForm?
>>
>> dziekuje/
>> M-
>> ---------------------------------------------------------------------------
>> This e-mail message (including attachments, if any) is intended for the
>> use of the individual or entity to which it is addressed and may contain
>> information that is privileged, proprietary , confidential and exempt from
>> disclosure. If you are not the intended recipient, you are notified that
>> any dissemination, distribution or copying of this communication is
>> strictly prohibited.
>> ---------------------------------------------------------------------------
>> Le présent message électronique (y compris les pièces qui y sont annexées,
>> le cas échéant) s'adresse au destinataire indiqué et peut contenir des
>> renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le
>> destinataire de ce document, nous vous signalons qu'il est strictement
>> interdit de le diffuser, de le distribuer ou de le reproduire.
>> ----- Original Message -----
>> From: "puchacz" <zmychu@(protected)>
>> To: <user@(protected)>
>> Sent: Sunday, February 11, 2007 4:03 PM
>> Subject: Collecting data from few pages
>>
>>
>>>
>>> Hi
>>>
>>> I have a problem. I would like to write application, where I would have
>>> sth.
>>> like "wizard". Using this "wizard" I would take information from user
>>> about
>>> name, lastname, etc. The thing is that I have no idea how I can collect
>>> all
>>> this information and then on the last step save it to DB .
>>>
>>> Could You give me this bright idea how it should be done ? I mean how to
>>> collect all the information from few pages (wizards). I would be very
>>> very
>>> thankful if You could show me some example of this.
>>>
>>> Thanx so much!!!
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Collecting-data-from-few-pages-tf3210236.html#a8914849
>>> Sent from the Struts - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.