• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Struts wizard problem

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have 3 jsp's forming a 3-step wizard, 1 DispatchAction class, 1 Formbean class with an old style validate() method, I have this action mapping in struts-config.xml:


<action
path="/processinvitation"
type="nl.path.org.struts.host.HostInvitationDispatchAction"
scope="session"
name="editinvitation"
input="/jsp/HostNewInvitation_step1.jsp"
parameter="action"
validate="false">

<forward name="step1" path="/jsp/HostNewInvitation_step1.jsp" />
<forward name="step2" path="/jsp/HostNewInvitation_step2.jsp" />
<forward name="step3" path="/jsp/HostNewInvitation_step3.jsp" />
<forward name="invalid" path="/jsp/HostNewInvitation_step1.jsp"/>
<forward name="valid" path="/populatehosthomepage.do"/>
</action>

Now if something goes wrong in step1 the page HostNewInvitation_step1.jsp correctly gets displayed with correct errormsgs.

But how do I get page HostNewInvitation_step2.jsp invoked if something goes wrong in step 2 ??
There is only one input element in this tag.
I tried: input="/processinvitation?action=validate"
with a validate() method added to my action class, but that does not work.

How do you tackle this problem in general ?

Thanks in advance !

[ August 08, 2005: Message edited by: Jan van Doorn ]
[ September 01, 2005: Message edited by: Jan van Doorn ]
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One possibility would be to define an action for each page of the wizard (e.g. processInvitation_p1, processInvitation_p2, etc). You can still use the same action class and form bean; just define different paths and different input JSPs. Then change the action of the form in each JSP to match the new action definitions. If you don't want to redefine the forwards for each action, you can make them global forwards.
 
Jan van Doorn
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Merrill !!!

That did it !

 
Willie Smits can speak 40 languages. This tiny ad can speak only one:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic