Out of the two options outlined by Laurie the first is the proper one
;-) The second option works for sequence of pages, but not for a
wizard. A wizard is a single stateful object with multiple views
depending on wizard state. A page sequence is just sequence of web
resources/pages not necessarily corresponding to one particular state
object.

You can build a bulletproof wizard by:
* storing state in session;
* using exactly the same URLs for all wizard views (including parameters);
* using redirection between data input and page render.
If you do all of this, many (most?) browsers will not accumulate
wizard pages in their page history, so a user will not be able to
click Back button and to return to previous wizard page. I user will
also be able to use Reload button safely.

Try this: 
http://downloads.sourceforge.net/struts/dialogs-samples-2.0.war?modtime=1141554060&big_mirror=1

Run it and see Multiple-step wizard sample. If you like what you see,
the source code is included ;-)

Other choice is to use Ajax and to place wizard views into
asynchronously reloadable HTML container. In this case it does not
really matter how URLs look like and whether you use forwarding or
redirection.

Michael.

On 2/12/07, Laurie Harper <[EMAIL PROTECTED]> wrote:
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" <[EMAIL PROTECTED]>
>> To: <user@struts.apache.org>
>> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to