Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{snippet:id=description|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.Validation}

Usage

Wiki Markup
{snippet:id=usage|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.Validation}

Parameters

Wiki Markup
{snippet:id=parameters|javadoc=true|url=com.opensymphony.xwork2.validator.annotations.Validation}

Examples

An Annotated Interface

  • Mark the interface with @Validation()
  • Apply standard or custom annoations at method level
Wiki Markup
{snippet:id=example|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.Validation}

An Annotated Class

Wiki Markup
{snippet:id=example2|javadoc=true|lang=java|url=com.opensymphony.xwork2.validator.annotations.Validation}
Warning

When multiple methods are used to map different actions on the same class, and one of them is annotated with @Validations, those validators will be triggered for all the actions, unless they are annotated with @SkipValidation or validateAnnotatedMethodOnly is set to true in the "validation" interceptor, like:

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