Home > Guides > Core Developers Guide > Annotations > Validations Annotation
Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Usage

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Parameters

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Examples

Error formatting macro: snippet: java.lang.IndexOutOfBoundsException: Index: 20, Size: 20

Different validations per method

Different validations per method is NOT supported for client-side validation!

To use different validations per method, the validateAnnotatedMethodOnly property must be set on the validation interceptor.

<interceptor-ref name="validation">
  <param name="validateAnnotatedMethodOnly">true</param>                
  <param name="excludeMethods">input,back,cancel,browse</param>
</interceptor-ref>

Here's a complete example of updating the default stack:

  <package name="default" extends="struts-default">
    <interceptors>
      <interceptor-stack name="content">
        <interceptor-ref name="exception"/>
                <interceptor-ref name="alias"/>
                <interceptor-ref name="servletConfig"/>
                <interceptor-ref name="prepare"/>
                <interceptor-ref name="i18n"/>
                <interceptor-ref name="chain"/>
                <interceptor-ref name="debugging"/>
                <interceptor-ref name="profiling"/>
                <interceptor-ref name="scopedModelDriven"/>
                <interceptor-ref name="modelDriven"/>
                <interceptor-ref name="fileUpload"/>
                <interceptor-ref name="checkbox"/>
                <interceptor-ref name="staticParams"/>
                <interceptor-ref name="params">
                  <param name="excludeParams">dojo\..*</param>
                </interceptor-ref>
                <interceptor-ref name="conversionError"/>
                <interceptor-ref name="validation">
  	            <param name="validateAnnotatedMethodOnly">true</param>                
                    <param name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
                <interceptor-ref name="workflow">
                    <param name="excludeMethods">input,back,cancel,browse</param>
                </interceptor-ref>
      </interceptor-stack>
    </interceptors>
    <default-interceptor-ref name="default"/>
  </package>
</struts>