You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Shrinivas Parashar <Sh...@symantec.com> on 2012/02/01 14:01:50 UTC

Wizard (multipage flow) with Struts 2

Hi,
Has anyone developed Wizard in Struts 2 without using Spring webflow plugin. Practical Apache Struts 2 book has an example to develop wizard using scope interceptor. But Scope interceptor does not seem to work with ModelDriven interceptor.
If anyone has working example, please share the same.
Regards,
Shrinivas

RE: Wizard (multipage flow) with Struts 2

Posted by "Biesbrock, Kevin" <Bi...@aoins.com>.
I haven't had a need for it. It just sounded like the best case for your scenario (I think).

Beez


-----Original Message-----
From: Shrinivas Parashar [mailto:Shrinivas_Parashar@symantec.com] 
Sent: Thursday, February 02, 2012 12:27 AM
To: Struts Users Mailing List
Subject: RE: Wizard (multipage flow) with Struts 2

Yes, I am looking at that. Have you used that?

Regards,
Shrinivas 

-----Original Message-----
From: Biesbrock, Kevin [mailto:Biesbrock.Kevin@aoins.com] 
Sent: 02 February 2012 00:54
To: 'Struts Users Mailing List'
Subject: RE: Wizard (multipage flow) with Struts 2

Did you already look at the ScopedModelDriven<E> approach?

Beez


-----Original Message-----
From: Shrinivas Parashar [mailto:Shrinivas_Parashar@symantec.com] 
Sent: Wednesday, February 01, 2012 8:39 AM
To: Struts Users Mailing List
Subject: RE: Wizard (multipage flow) with Struts 2

Thanks eric for the information.
I was looking for interceptor based approach where struts would handle putting model in the session, retrieving from the session, removing from session at the end of wizard. Scope interceptor provides similar thing, but this does not work with modeldriven actions.

-Shrinivas

-----Original Message-----
From: Eric Lentz [mailto:Eric.Lentz@sherwin.com] 
Sent: 01 February 2012 18:46
To: Struts Users Mailing List
Subject: Re: Wizard (multipage flow) with Struts 2

> Has anyone developed Wizard in Struts 2 without using Spring webflow 
plugin.

I have done it with and without jQuery, but find that the jQuery form 
wizard plug-in [1] is by far the easiest. In short, you create a div each 
to represent each step and add class="step" to the div, and you're pretty 
much done as far as the wizard coding is considered. The plug-in handles 
breaking the form into multiple wizard steps. Then the wizard pages look 
like 1 big form to Struts 2 when the last page is submitted (the plug-in 
handles making the last page a submit). Validations can be handled via the 
validation plug-in. You probably want a paranoid validation step at the 
action level. If there is an error there, that the jQuery validation 
didn't catch, then there was probably some outside manipulation (if you 
did validations correctly) and a generic error message, outside of the 
wizard, would be acceptable and probably never seen by the average user.

If you don't use jQuery, then just store the object you're dealing with 
(model) in the session and iteratively update it at the end of each wizard 
step. If there is more than just the one model object, then store a DTO in 
the session and call that your model. That's essentially how I did it 
anyway, without going into every gory detail which I don't really have 
time for.

[1] http://thecodemine.org/


---------------------------------------------------------------------
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


---------------------------------------------------------------------
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


Re: Wizard (multipage flow) with Struts 2

Posted by Volker Krebs <vo...@abas.de>.
Struts2 webflow integration only works with Spring Web Flow 1.0.6
Webflow 2.x does not compile.

2 years ago I tried to refactor the plugin, but then other things became
more important. But with a bit of afford 

regards,
Volker

http://code.google.com/p/struts2webflow/
http://forum.springsource.org/showthread.php?59326-Web-Flow-2-and-struts2


On Di, 2012-02-14 at 18:54 -0600, Muneer Malik wrote: 
> why not just use the webflow plugin which is available part of Spring framework ? and can be incorporated into Struts 2. 
> 
> Best,
> Muneer Malik
> 
> On Feb 13, 2012, at 11:05 PM, rees <re...@gmail.com> wrote:
> 
> > Try this out for a multipage struts2 flow: 
> > http://code.google.com/p/struts2-conversation/
> > 
> > 




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


Re: Wizard (multipage flow) with Struts 2

Posted by Muneer Malik <tu...@gmail.com>.
why not just use the webflow plugin which is available part of Spring framework ? and can be incorporated into Struts 2. 

Best,
Muneer Malik

On Feb 13, 2012, at 11:05 PM, rees <re...@gmail.com> wrote:

> Try this out for a multipage struts2 flow: 
> http://code.google.com/p/struts2-conversation/
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Re: Wizard (multipage flow) with Struts 2

Posted by rees <re...@gmail.com>.
Try this out for a multipage struts2 flow: 
http://code.google.com/p/struts2-conversation/




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


RE: Wizard (multipage flow) with Struts 2

Posted by Shrinivas Parashar <Sh...@symantec.com>.
Yes, I am looking at that. Have you used that?

Regards,
Shrinivas 

-----Original Message-----
From: Biesbrock, Kevin [mailto:Biesbrock.Kevin@aoins.com] 
Sent: 02 February 2012 00:54
To: 'Struts Users Mailing List'
Subject: RE: Wizard (multipage flow) with Struts 2

Did you already look at the ScopedModelDriven<E> approach?

Beez


-----Original Message-----
From: Shrinivas Parashar [mailto:Shrinivas_Parashar@symantec.com] 
Sent: Wednesday, February 01, 2012 8:39 AM
To: Struts Users Mailing List
Subject: RE: Wizard (multipage flow) with Struts 2

Thanks eric for the information.
I was looking for interceptor based approach where struts would handle putting model in the session, retrieving from the session, removing from session at the end of wizard. Scope interceptor provides similar thing, but this does not work with modeldriven actions.

-Shrinivas

-----Original Message-----
From: Eric Lentz [mailto:Eric.Lentz@sherwin.com] 
Sent: 01 February 2012 18:46
To: Struts Users Mailing List
Subject: Re: Wizard (multipage flow) with Struts 2

> Has anyone developed Wizard in Struts 2 without using Spring webflow 
plugin.

I have done it with and without jQuery, but find that the jQuery form 
wizard plug-in [1] is by far the easiest. In short, you create a div each 
to represent each step and add class="step" to the div, and you're pretty 
much done as far as the wizard coding is considered. The plug-in handles 
breaking the form into multiple wizard steps. Then the wizard pages look 
like 1 big form to Struts 2 when the last page is submitted (the plug-in 
handles making the last page a submit). Validations can be handled via the 
validation plug-in. You probably want a paranoid validation step at the 
action level. If there is an error there, that the jQuery validation 
didn't catch, then there was probably some outside manipulation (if you 
did validations correctly) and a generic error message, outside of the 
wizard, would be acceptable and probably never seen by the average user.

If you don't use jQuery, then just store the object you're dealing with 
(model) in the session and iteratively update it at the end of each wizard 
step. If there is more than just the one model object, then store a DTO in 
the session and call that your model. That's essentially how I did it 
anyway, without going into every gory detail which I don't really have 
time for.

[1] http://thecodemine.org/


---------------------------------------------------------------------
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


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


RE: Wizard (multipage flow) with Struts 2

Posted by "Biesbrock, Kevin" <Bi...@aoins.com>.
Did you already look at the ScopedModelDriven<E> approach?

Beez


-----Original Message-----
From: Shrinivas Parashar [mailto:Shrinivas_Parashar@symantec.com] 
Sent: Wednesday, February 01, 2012 8:39 AM
To: Struts Users Mailing List
Subject: RE: Wizard (multipage flow) with Struts 2

Thanks eric for the information.
I was looking for interceptor based approach where struts would handle putting model in the session, retrieving from the session, removing from session at the end of wizard. Scope interceptor provides similar thing, but this does not work with modeldriven actions.

-Shrinivas

-----Original Message-----
From: Eric Lentz [mailto:Eric.Lentz@sherwin.com] 
Sent: 01 February 2012 18:46
To: Struts Users Mailing List
Subject: Re: Wizard (multipage flow) with Struts 2

> Has anyone developed Wizard in Struts 2 without using Spring webflow 
plugin.

I have done it with and without jQuery, but find that the jQuery form 
wizard plug-in [1] is by far the easiest. In short, you create a div each 
to represent each step and add class="step" to the div, and you're pretty 
much done as far as the wizard coding is considered. The plug-in handles 
breaking the form into multiple wizard steps. Then the wizard pages look 
like 1 big form to Struts 2 when the last page is submitted (the plug-in 
handles making the last page a submit). Validations can be handled via the 
validation plug-in. You probably want a paranoid validation step at the 
action level. If there is an error there, that the jQuery validation 
didn't catch, then there was probably some outside manipulation (if you 
did validations correctly) and a generic error message, outside of the 
wizard, would be acceptable and probably never seen by the average user.

If you don't use jQuery, then just store the object you're dealing with 
(model) in the session and iteratively update it at the end of each wizard 
step. If there is more than just the one model object, then store a DTO in 
the session and call that your model. That's essentially how I did it 
anyway, without going into every gory detail which I don't really have 
time for.

[1] http://thecodemine.org/


---------------------------------------------------------------------
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


RE: Wizard (multipage flow) with Struts 2

Posted by Shrinivas Parashar <Sh...@symantec.com>.
Thanks eric for the information.
I was looking for interceptor based approach where struts would handle putting model in the session, retrieving from the session, removing from session at the end of wizard. Scope interceptor provides similar thing, but this does not work with modeldriven actions.

-Shrinivas

-----Original Message-----
From: Eric Lentz [mailto:Eric.Lentz@sherwin.com] 
Sent: 01 February 2012 18:46
To: Struts Users Mailing List
Subject: Re: Wizard (multipage flow) with Struts 2

> Has anyone developed Wizard in Struts 2 without using Spring webflow 
plugin.

I have done it with and without jQuery, but find that the jQuery form 
wizard plug-in [1] is by far the easiest. In short, you create a div each 
to represent each step and add class="step" to the div, and you're pretty 
much done as far as the wizard coding is considered. The plug-in handles 
breaking the form into multiple wizard steps. Then the wizard pages look 
like 1 big form to Struts 2 when the last page is submitted (the plug-in 
handles making the last page a submit). Validations can be handled via the 
validation plug-in. You probably want a paranoid validation step at the 
action level. If there is an error there, that the jQuery validation 
didn't catch, then there was probably some outside manipulation (if you 
did validations correctly) and a generic error message, outside of the 
wizard, would be acceptable and probably never seen by the average user.

If you don't use jQuery, then just store the object you're dealing with 
(model) in the session and iteratively update it at the end of each wizard 
step. If there is more than just the one model object, then store a DTO in 
the session and call that your model. That's essentially how I did it 
anyway, without going into every gory detail which I don't really have 
time for.

[1] http://thecodemine.org/


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


Re: Wizard (multipage flow) with Struts 2

Posted by Eric Lentz <Er...@sherwin.com>.
> Has anyone developed Wizard in Struts 2 without using Spring webflow 
plugin.

I have done it with and without jQuery, but find that the jQuery form 
wizard plug-in [1] is by far the easiest. In short, you create a div each 
to represent each step and add class="step" to the div, and you're pretty 
much done as far as the wizard coding is considered. The plug-in handles 
breaking the form into multiple wizard steps. Then the wizard pages look 
like 1 big form to Struts 2 when the last page is submitted (the plug-in 
handles making the last page a submit). Validations can be handled via the 
validation plug-in. You probably want a paranoid validation step at the 
action level. If there is an error there, that the jQuery validation 
didn't catch, then there was probably some outside manipulation (if you 
did validations correctly) and a generic error message, outside of the 
wizard, would be acceptable and probably never seen by the average user.

If you don't use jQuery, then just store the object you're dealing with 
(model) in the session and iteratively update it at the end of each wizard 
step. If there is more than just the one model object, then store a DTO in 
the session and call that your model. That's essentially how I did it 
anyway, without going into every gory detail which I don't really have 
time for.

[1] http://thecodemine.org/