You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeff Trent <jt...@structsoft.com> on 2001/05/08 21:16:35 UTC

Override Input Form / JSP when Errors Are Encountered

When validate() returns an error collection, the framework takes me back to the input page (page1).  How do I override this?  I have a multi-page input wizard as shown below.  I'd like to stay on the page that resulted in the error instead of going back to page 1.

    <action    path="/someWizard"
               type="com.x.WizardAction"
               name="wizardForm"
              scope="session"
              input="/page1.jsp">
        <forward   name="page2"              path="/page2.jsp"/>
        <forward   name="page3"        path="/page3.jsp"/>
    </action>


Re: Override Input Form / JSP when Errors Are Encountered

Posted by Jeff Trent <jt...@structsoft.com>.
Ah, okay.  So I should call validate() within the action class directly then?  I'll play around with this approach.
  ----- Original Message ----- 
  From: William Jaynes 
  To: struts-user@jakarta.apache.org 
  Sent: Wednesday, May 09, 2001 6:58 AM
  Subject: Re: Override Input Form / JSP when Errors Are Encountered


  Use 'validate="false"' as an action attribute to prevent a return to the input page after a failed validate. Struts will continue on to the action, and you'll need to decide what to do there.
    ----- Original Message ----- 
    From: Jeff Trent 
    To: struts-user@jakarta.apache.org 
    Sent: Tuesday, May 08, 2001 3:16 PM
    Subject: Override Input Form / JSP when Errors Are Encountered


    When validate() returns an error collection, the framework takes me back to the input page (page1).  How do I override this?  I have a multi-page input wizard as shown below.  I'd like to stay on the page that resulted in the error instead of going back to page 1.

        <action    path="/someWizard"
                   type="com.x.WizardAction"
                   name="wizardForm"
                  scope="session"
                  input="/page1.jsp">
            <forward   name="page2"              path="/page2.jsp"/>
            <forward   name="page3"        path="/page3.jsp"/>
        </action>


Re: Override Input Form / JSP when Errors Are Encountered

Posted by William Jaynes <wj...@mediaone.net>.
Use 'validate="false"' as an action attribute to prevent a return to the input page after a failed validate. Struts will continue on to the action, and you'll need to decide what to do there.
  ----- Original Message ----- 
  From: Jeff Trent 
  To: struts-user@jakarta.apache.org 
  Sent: Tuesday, May 08, 2001 3:16 PM
  Subject: Override Input Form / JSP when Errors Are Encountered


  When validate() returns an error collection, the framework takes me back to the input page (page1).  How do I override this?  I have a multi-page input wizard as shown below.  I'd like to stay on the page that resulted in the error instead of going back to page 1.

      <action    path="/someWizard"
                 type="com.x.WizardAction"
                 name="wizardForm"
                scope="session"
                input="/page1.jsp">
          <forward   name="page2"              path="/page2.jsp"/>
          <forward   name="page3"        path="/page3.jsp"/>
      </action>