You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Chadha, Deepak (BLM)" <De...@express-scripts.com> on 2003/10/22 16:14:03 UTC

Re-used Action class

Hi,
I have a (hopefully) simple question.
I have a ActionForm / Action pair invoked from several JSP pages (actually the JSP fragment is included into several JSP pages).

I am trying to use the ActionForm.validate method in combination with the <html:errors/> tag.  The problem is that when there is a Form validation error, the INPUT property of the mapping is used to send the user back where he came from.  However, there can only be 1 INPUT specified for a given mapping.

In my case, I want to invoke the same action from several pages, and want the user to be sent back to correct errors on the page they were on.

Any ideas?

Thanks
Deepak
******* Confidentiality Notice *******
This email, its electronic document attachments, and the contents of its website linkages may contain confidential health information.  This information is intended solely for use by the individual or entity to whom it is addressed.  If you have received this information in error, please notify the sender immediately and arrange for the prompt destruction of the material and any accompanying attachments.



Re: Re-used Action class

Posted by Geeta Ramani <ge...@cmpco.com>.
Deepak:

If i understand your problem correctly, the following should work (for case of two jsps - you can expand to more of course..):  In your struts-config.xml simply have say two different action mappings, call them say action1 and action2.  Make them both point to the same Action class but have the input field point to jsp1 and jsp2 respectively. In your jsps of course you will want to change the action of your
form to action1.do or action2.do.. Should work..

Regards,
Geeta

"Chadha, Deepak (BLM)" wrote:

> Hi,
> I have a (hopefully) simple question.
> I have a ActionForm / Action pair invoked from several JSP pages (actually the JSP fragment is included into several JSP pages).
>
> I am trying to use the ActionForm.validate method in combination with the <html:errors/> tag.  The problem is that when there is a Form validation error, the INPUT property of the mapping is used to send the user back where he came from.  However, there can only be 1 INPUT specified for a given mapping.
>
> In my case, I want to invoke the same action from several pages, and want the user to be sent back to correct errors on the page they were on.
>
> Any ideas?
>
> Thanks
> Deepak
> ******* Confidentiality Notice *******
> This email, its electronic document attachments, and the contents of its website linkages may contain confidential health information.  This information is intended solely for use by the individual or entity to whom it is addressed.  If you have received this information in error, please notify the sender immediately and arrange for the prompt destruction of the material and any accompanying attachments.


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org