Class RejectedFormValuesInterceptor
java.lang.Object
org.apache.struts2.interceptor.AbstractInterceptor
org.apache.struts2.interceptor.MethodFilterInterceptor
name.matthewgreet.strutscommons.interceptor.RejectedFormValuesInterceptor
- All Implemented Interfaces:
Serializable,ConditionalInterceptor,Interceptor
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:
-
Field Summary
Fields inherited from class org.apache.struts2.interceptor.MethodFilterInterceptor
excludeMethods, includeMethods -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringdoIntercept(ActionInvocation invocation) booleanintReturns maximum number entries of an array or collection field.voidsetDisabled(boolean disabled) voidsetParamMaxListSize(int paramMaxListSize) Methods inherited from class org.apache.struts2.interceptor.MethodFilterInterceptor
applyInterceptor, getExcludeMethodsSet, getIncludeMethodsSet, intercept, setExcludeMethods, setIncludeMethodsMethods inherited from class org.apache.struts2.interceptor.AbstractInterceptor
destroy, init, setDisabled, shouldIntercept
-
Constructor Details
-
RejectedFormValuesInterceptor
public RejectedFormValuesInterceptor()
-
-
Method Details
-
doIntercept
- Specified by:
doInterceptin classMethodFilterInterceptor- 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)
-