com.opensymphony.xwork2.interceptor

## Class ModelDrivenInterceptor

- java.lang.Object
- - org.apache.struts2.interceptor.AbstractInterceptor
  - - com.opensymphony.xwork2.interceptor.AbstractInterceptor
    - - com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor

- All Implemented Interfaces:
    Serializable, ConditionalInterceptor, Interceptor

  Deprecated.
  since 6.7.0, use `ModelDrivenInterceptor` instead.

      @Deprecated
      public class ModelDrivenInterceptor
      extends AbstractInterceptor

  Watches for `ModelDriven` actions and adds the action's model on to the value stack.

  Note: The ModelDrivenInterceptor must come before the both `StaticParametersInterceptor` and `ParametersInterceptor` if you want the parameters to be applied to the model.

  Note: The ModelDrivenInterceptor will only push the model into the stack when the model is not null, else it will be ignored.

  Interceptor parameters:

  - refreshModelBeforeResult - set to true if you want the model to be refreshed on the value stack after action execution and before result execution. The setting is useful if you want to change the model instance during the action execution phase, like when loading it from the data layer. This will result in getModel() being called at least twice.

  Extending the interceptor:

  There are no known extension points to this interceptor.

  Example code:

       <action name="someAction" class="com.examples.SomeAction">
           <interceptor-ref name="modelDriven"/>
           <interceptor-ref name="basicStack"/>
           <result name="success">good_result.ftl</result>
       </action>

  Version:
    $Date$ $Id$
  Author:
    tm_jee
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `protected static class` | `ModelDrivenInterceptor.RefreshModelBeforeResult` Deprecated. Refreshes the model instance on the value stack, if it has changed

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

      `ConditionalInterceptor.LegacyAdapter`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `refreshModelBeforeResult` Deprecated.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ModelDrivenInterceptor()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `intercept(ActionInvocation invocation)` Deprecated. Override to handle interception
    `void` | `setRefreshModelBeforeResult(boolean val)` Deprecated.

    - ### 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 com.opensymphony.xwork2.interceptor.ConditionalInterceptor

      `adapt`

    - ### Methods inherited from interface com.opensymphony.xwork2.interceptor.Interceptor

      `adapt`

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

      `destroy, init`

- - ### Field Detail

    - #### refreshModelBeforeResult

          protected boolean refreshModelBeforeResult

      Deprecated.

  - ### Constructor Detail

    - #### ModelDrivenInterceptor

          public ModelDrivenInterceptor()

      Deprecated.

  - ### Method Detail

    - #### setRefreshModelBeforeResult

          public void setRefreshModelBeforeResult(boolean val)

      Deprecated.

    - #### intercept

          public String intercept(ActionInvocation invocation)
                           throws Exception

      Deprecated.
      Description copied from class: `AbstractInterceptor`
      Override to handle interception
      Specified by:
        `intercept` in class `AbstractInterceptor`
      Throws:
        `Exception`

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.