Class RejectedFormValuesInterceptor

All Implemented Interfaces:
Serializable, ConditionalInterceptor, Interceptor

public class RejectedFormValuesInterceptor extends MethodFilterInterceptor

Struts 2 Interceptor for setting conversion errors as overriding properties of the Value Stack, so rejected and failed form field values are displayed. This is the same as ConversionErrorInterceptor except it doesn't write error messages as AnnotationValidationInterceptor is expected to do this. In Interceptor stacks, it must be placed after interceptors to write or inject conversion errors, such as AnnotationValidationIntercetpor2 and FormRetrieveInterceptor, and after StaticParametersInterceptor as that wipes conversion errors.

Interceptor parameters:

disabled
If true, this interceptor is skipped.
paramMaxListSize
Maximum number entries of an array or collection field. Defaults to 256.

Extending the interceptor:

This can't be usefully extended.

Example code:

 <action name="someAction" class="com.examples.SomeAction">
     <interceptor-ref name="staticParams"/>
     <interceptor-ref name="rejectedFormValues"/>
     <result name="success">good_result.ftl</result>
 </action>
 
 
See Also:
  • Constructor Details

    • RejectedFormValuesInterceptor

      public RejectedFormValuesInterceptor()
  • Method Details

    • doIntercept

      protected String doIntercept(ActionInvocation invocation) throws Exception
      Specified by:
      doIntercept in class MethodFilterInterceptor
      Throws:
      Exception
    • getDisabled

      public boolean getDisabled()
    • setDisabled

      public void setDisabled(boolean disabled)
    • getParamMaxListSize

      public int getParamMaxListSize()
      Returns maximum number entries of an array or collection field. Defaults to 256.
    • setParamMaxListSize

      public void setParamMaxListSize(int paramMaxListSize)