You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by puchacz <zm...@wp.pl> on 2007/02/12 09:03:18 UTC

Re: [S2] Collecting data from few pages

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" <zm...@wp.pl>
> To: <us...@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: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>>
> 

-- 
View this message in context: http://www.nabble.com/Collecting-data-from-few-pages-tf3210236.html#a8920237
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [S2] Collecting data from few pages

Posted by puchacz <zm...@wp.pl>.
Thank You for Your answer!

You know, I had finished my aplication using secod option few seconds before
You answered me :). But still thank You very much for help. 

But I have to tell You that I am little disappointed of the strategy using
in Struts. I was wating for some special controllers to help with my wizard,
but You show me that there is nothing like this :(. In the other hand maybe
it is better that it is so simple mathod :) ? 

Thanx
 

Laurie Harper 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" <zm...@wp.pl>
>>> To: <us...@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: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Collecting-data-from-few-pages-tf3210236.html#a8929849
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: [S2] Collecting data from few pages

Posted by Michael Jouravlev <jm...@gmail.com>.
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 <la...@holoweb.net> 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" <zm...@wp.pl>
> >> To: <us...@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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [S2] Collecting data from few pages

Posted by Laurie Harper <la...@holoweb.net>.
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" <zm...@wp.pl>
>> To: <us...@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: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
> 



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