Class FormFormatterInterceptor
java.lang.Object
org.apache.struts2.interceptor.AbstractInterceptor
com.opensymphony.xwork2.interceptor.AbstractInterceptor
name.matthewgreet.strutscommons.interceptor.FormFormatterInterceptor
- All Implemented Interfaces:
ConditionalInterceptor,Interceptor,Serializable,ConditionalInterceptor,Interceptor
Struts 2 Interceptor used by view Actions for writing formatted versions of forms onto the Value Stack, so they're
displayed instead of the unformatted form, using any conversion annotations on form fields. Such forms must
implement FormattableForm. Does not apply to injected forms as its conversion errors are copied.
Interceptor parameters:
- disabled
- If true, all processing for this action is disabled. Defaults to false.
Extending the interceptor:
The following methods can be overridden :-
- makeFormFormatLibrary
- Creates helper that formats form.
- makePolicyLookup
- Creates helper that finds policy implementation from the annotation that configures it.
Example code:
<action name="someAction" class="com.examples.SomeAction">
<interceptor-ref name="annotationValidation"/>
<interceptor-ref name="validation"/>
<interceptor-ref name="formFormatter"/>
<result name="success">good_result.ftl</result>
</action>
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.opensymphony.xwork2.interceptor.ConditionalInterceptor
ConditionalInterceptor.LegacyAdapter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintercept(ActionInvocation invocation) protected FormFormatterCreates and returns helper that formats form field values.protected PolicyLookupCreates and returns helper that finds a policy implementation from a form field adjuster, converter, or validator annotation.voidsetDisabled(boolean disabled) Methods inherited from class com.opensymphony.xwork2.interceptor.AbstractInterceptor
intercept, shouldIntercept, shouldInterceptMethods inherited from class org.apache.struts2.interceptor.AbstractInterceptor
destroy, init, setDisabledMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.struts2.interceptor.Interceptor
destroy, init
-
Constructor Details
-
FormFormatterInterceptor
public FormFormatterInterceptor()
-
-
Method Details
-
makeFormFormatLibrary
Creates and returns helper that formats form field values. -
makePolicyLookup
Creates and returns helper that finds a policy implementation from a form field adjuster, converter, or validator annotation. Does not scan for non-built-in, non-custom policies if disabledClassScanner is true. -
getDisabled
public boolean getDisabled() -
setDisabled
public void setDisabled(boolean disabled) -
intercept
- Specified by:
interceptin interfaceInterceptor- Specified by:
interceptin classAbstractInterceptor- Throws:
Exception
-