Class FormFormatterInterceptor

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

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

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:

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:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
     

    Nested classes/interfaces inherited from interface com.opensymphony.xwork2.interceptor.ConditionalInterceptor

    com.opensymphony.xwork2.interceptor.ConditionalInterceptor.LegacyAdapter
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    intercept(com.opensymphony.xwork2.ActionInvocation invocation)
     
    protected FormFormatter
     
    void
    setDisabled(boolean disabled)
     

    Methods inherited from class com.opensymphony.xwork2.interceptor.AbstractInterceptor

    intercept, shouldIntercept, shouldIntercept

    Methods inherited from class org.apache.struts2.interceptor.AbstractInterceptor

    destroy, init, setDisabled

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.struts2.interceptor.Interceptor

    destroy, init
  • Constructor Details

    • FormFormatterInterceptor

      public FormFormatterInterceptor()
  • Method Details

    • makeFormFormatLibrary

      protected FormFormatter makeFormFormatLibrary()
    • getDisabled

      public boolean getDisabled()
    • 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
    • setDisabled

      public void setDisabled(boolean disabled)