You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mallik <ma...@yahoo.com> on 2006/11/13 08:07:12 UTC

DispatchAction help?

HI friends
i am using DispatchAction but i don't want to validate for some buttons and
i want validate the data for some another buttons
like suppose
i have
 "save" (to add the data and go to view details page) for this validation
should work
 "Add more" (to add the data and back to same page) for this validation
should work
 "cancel" (just go back) for this validation should not work
 "View" (just go to View page) for this validation should not work

how can i do this
help me please

Ur's
Mallik





-- 
View this message in context: http://www.nabble.com/DispatchAction--help--tf2620433.html#a7312355
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: DispatchAction help?

Posted by Ed Griebel <ed...@gmail.com>.
You should do validation manually in your action. Set
"validation='false'" in your struts-config.xml and call form.validate
in the action methods that need to be validated on. For example, do
something like this in a method:

ActionMessages errors = form.validate(mapping,request);
if ( errors != null && errors.size() > 0 ) {
    saveErrors(request, errors);
    return mapping.getInputForward(); // if action defines input= in
struts-config.xml
}

-ed

On 11/13/06, Mallik <ma...@yahoo.com> wrote:
>
> HI friends
> i am using DispatchAction but i don't want to validate for some buttons and
> i want validate the data for some another buttons
> like suppose
> i have
>  "save" (to add the data and go to view details page) for this validation
> should work
>  "Add more" (to add the data and back to same page) for this validation
> should work
>  "cancel" (just go back) for this validation should not work
>  "View" (just go to View page) for this validation should not work
>
> how can i do this
> help me please
>
> Ur's
> Mallik
>
>
>
>
>
> --
> View this message in context: http://www.nabble.com/DispatchAction--help--tf2620433.html#a7312355
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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