File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redisplaying a page after validation due to validation errors?

 
Ajay Xavier
Ranch Hand
Posts: 109
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Brent Sterling
Ranch Hand
Posts: 948
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic