You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ja...@us.cgeyc.com on 2001/11/19 23:26:58 UTC

returning to the correct page when the validate() method returns errors.

I'm using Struts 1.0 and I have a situation where multiple jsps pages use
the same ActionForm.

As I understand it, when the Form's validate() method returns an error,
then the ActionServlet forwards control to the "input" page where "input"
is the input specified in the struts-config.xml file.  The problem is that
I can only specify 1 input page in the struts-config.xml file but I can
have multiple input pages.  When the Form's validate() method returns an
error, I will always go to page specified by the input var in
struts-config.xml, even if this is not the page that I came from.

What is the best way to have control go back to the actual input page?  It
seems to me that I can pass in the name of the page and override the
processValidate() method of the ActionServlet to handle multiple input
pages.  Is there a better way to forward control back to the page that
submitted the form?

Thanks for your help!

Jason Gola
jason.gola@us.cgeyc.com



______________________________________________________________________
This message contains information that may be privileged or confidential
and is the property of the Cap Gemini Ernst & Young Group.  It is intended
only for the person to whom it is addressed.  If you are not the intended
recipient, you are not authorized to read, print, retain, copy,
disseminate, distribute, or use this message or any part thereof. If you
receive this message in error, please notify the sender immediately and
delete all copies of this message


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


forms with duplicate attributes

Posted by Peter Georgiou <pe...@btinternet.com>.
Hi

I'm developing a struts web app with several ActionForm objects which share
the same attributes, eg name, address etc.  I actually have 3 separate forms
which require address details.  To cut down on code I've thought of having
ActionForms and child ActionForms which inherit their parent's attributes,
along with their own attributes.  Is it ok to implement ActionForm objects
like this in Struts?

Thanks

Peter



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: returning to the correct page when the validate() method returns errors.

Posted by "emmanuel.boudrant" <b7...@yahoo.fr>.
I've got the same pb, the solution I used is this:

I declare multiple actions with the same Action class.

my struts-config.xml :

    
    <action path="/saisiefiche1" 
            name="ficheForm1" 
            input="/saisiefiche1.jsp" 
            type="basepat.SaisieFicheAction">
      <forward name="suiv" path="/saisiefiche2.jsp"/>
    </action>

    <action path="/saisiefiche2" 
            name="ficheForm2" 
            input="/saisiefiche2.jsp" 
            type="basepat.SaisieFicheAction">
      <forward name="suiv" path="/saisiefiche3.jsp"/>
      <forward name="prec" path="/saisiefiche1.jsp"/>
    </action>

    <action path="/saisiefiche3" 
            name="ficheForm3" 
            input="/saisiefiche3.jsp" 
            type="basepat.SaisieFicheAction">
      <forward name="suiv" path="/fin.jsp"/>
      <forward name="supp" path="/supprime.jsp" />
      <forward name="prec" path="/saisiefiche2.jsp"/>
    </action>


 --- Jason.Gola@us.cgeyc.com a écrit : > 
> I'm using Struts 1.0 and I have a situation where
> multiple jsps pages use
> the same ActionForm.
> 
> As I understand it, when the Form's validate()
> method returns an error,
> then the ActionServlet forwards control to the
> "input" page where "input"
> is the input specified in the struts-config.xml
> file.  The problem is that
> I can only specify 1 input page in the
> struts-config.xml file but I can
> have multiple input pages.  When the Form's
> validate() method returns an
> error, I will always go to page specified by the
> input var in
> struts-config.xml, even if this is not the page that
> I came from.
> 
> What is the best way to have control go back to the
> actual input page?  It
> seems to me that I can pass in the name of the page
> and override the
> processValidate() method of the ActionServlet to
> handle multiple input
> pages.  Is there a better way to forward control
> back to the page that
> submitted the form?
> 
> Thanks for your help!
> 
> Jason Gola
> jason.gola@us.cgeyc.com
> 
> 
> 
>
______________________________________________________________________
> This message contains information that may be
> privileged or confidential
> and is the property of the Cap Gemini Ernst & Young
> Group.  It is intended
> only for the person to whom it is addressed.  If you
> are not the intended
> recipient, you are not authorized to read, print,
> retain, copy,
> disseminate, distribute, or use this message or any
> part thereof. If you
> receive this message in error, please notify the
> sender immediately and
> delete all copies of this message
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>  

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Courrier : http://courrier.yahoo.fr

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>