• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Redisplaying a page after validation due to validation errors?

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

I have the following entry in my Struts-config.xml

<action path="/TestAction"
roles="20"
scope="session"
type="myActionClass"
name="myActionForm"
input="/page1.jsp"
parameter="action">
<forward name="prepare"
path="/page1.jsp" />
<forward name="Create"
path="/OtherAction?action=prepare" />
<forward name="Perform"
path="/Page2.jsp" />
<forward name="Edit"
path="/page2.jsp" />
</action>

My action tag has multiple forward tags leading to multiple JSP. All JSP are associated with a single form bean. In my form bean i had overridden the validate() method. If validation fails, the page specified in the "input" attribute of the <action> tag is redisplayed.

In my case i had given first jsp page (page1.jsp) in the "input" attribute. If validation fails in any of the pages it redisplays the first jsp page. Even if validation fails in the fourth or fifth jsp page it redisplays the first jsp page. Is there any way we can rediplay the current page with validation errors?

Regards,
Ajay.
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are plenty of different ways to create wizard pages. For some ideas here are some mappings that I created for some wizard like pages. As far as your question, note that when the user submits a page, the action ProcessUserWizard is used. If validation fails it sends the user to another action, RefreshUserWizard. The RefreshUserWizard knows based on the valid of the "step" property (which is part of the form and a hidden field on the jsp) which page should be shown.


- Brent
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic