Class FormFormatterInterceptor

java.lang.Object
com.opensymphony.xwork2.interceptor.AbstractInterceptor
name.matthewgreet.strutscommons.interceptor.FormFormatterInterceptor
All Implemented Interfaces:
com.opensymphony.xwork2.interceptor.Interceptor, Serializable

public class FormFormatterInterceptor extends com.opensymphony.xwork2.interceptor.AbstractInterceptor

Struts 2 Interceptor for formatting annotated form fields from their parsed values. If the Action implements ModelDriven, the model is recognised as the form, not the action.

This is known to have design flaws that can make it incompatible with existing code. See Form Formatting

Interceptor parameters:

disabled
If true, all processing for this action is disabled. Defaults to false.

Extending the interceptor:

This interceptor cannot be usefully extended.

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:
  • Constructor Details

    • FormFormatterInterceptor

      public FormFormatterInterceptor()
  • Method Details

    • getDisabled

      public boolean getDisabled()
    • setDisabled

      public void setDisabled(boolean disabled)
    • intercept

      public String intercept(com.opensymphony.xwork2.ActionInvocation invocation) throws Exception
      Specified by:
      intercept in interface com.opensymphony.xwork2.interceptor.Interceptor
      Specified by:
      intercept in class com.opensymphony.xwork2.interceptor.AbstractInterceptor
      Throws:
      Exception