Pages Navigation Menu

Coding is much easier than you think

How to exclude action methods from validation in struts2

How to exclude action methods from validation in struts2

My Action class have the following methods,
** UPDATE: Struts 2 Complete tutorial now available here.
Consider a scenario where I want to apply validation for addAction and deleteAction method alone and not for other method , then all you to do a configuration in struts.xml file by listing all the methods you don’t want to be run through the validation framework in the excludeMethods parameter. Since we only want addElement and deleteElement validated, list the other two methods as follows:

<interceptor-ref name="validation">
    <param name="excludeMethods">updateAction,populateAction</param>


About Mohaideen Jamil

I'm a Full stack developer of IT exp in J2EE, AngularJs, MicroServices, Docker, Spring (Boot, MVC, Cloud), Bluemix, DevOps. Follow me on Facebook or Google Plus. If you like my tutorials, consider making a donation to this charity, thanks.

%d bloggers like this: