com.opensymphony.xwork2.interceptor

## Class ScopedModelDrivenInterceptor

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

- All Implemented Interfaces:
    Serializable, ConditionalInterceptor, Interceptor

  Deprecated.
  since 6.7.0, use `ScopedModelDrivenInterceptor` instead.

      @Deprecated
      public class ScopedModelDrivenInterceptor
      extends AbstractInterceptor

  An interceptor that enables scoped model-driven actions.

  This interceptor only activates on actions that implement the `ScopedModelDriven` interface. If detected, it will retrieve the model class from the configured scope, then provide it to the Action.

  Interceptor parameters:

  - className - The model class name. Defaults to the class name of the object returned by the getModel() method.
  - name - The key to use when storing or retrieving the instance in a scope. Defaults to the model class name.
  - scope - The scope to store and retrieve the model. Defaults to 'request' but can also be 'session'.

  Extending the interceptor:

  There are no known extension points for this interceptor.

  Example code:

       <-- Basic usage -->
       <interceptor name="scopedModelDriven" class="com.opensymphony.interceptor.ScopedModelDrivenInterceptor" />

       <-- Using all available parameters -->
       <interceptor name="gangsterForm" class="com.opensymphony.interceptor.ScopedModelDrivenInterceptor">
            <param name="scope">session</param>
            <param name="name">gangsterForm</param>
            <param name="className">com.opensymphony.example.GangsterForm</param>
        </interceptor>

  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `ConditionalInterceptor.LegacyAdapter`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScopedModelDrivenInterceptor()` 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
    `protected Object` | `resolveModel(ObjectFactory factory, ActionContext actionContext, String modelClassName, String modelScope, String modelName)` Deprecated.
    `void` | `setClassName(String className)` Deprecated.
    `void` | `setName(String name)` Deprecated.
    `void` | `setObjectFactory(ObjectFactory factory)` Deprecated.
    `void` | `setScope(String scope)` 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`

- - ### Constructor Detail

    - #### ScopedModelDrivenInterceptor

          public ScopedModelDrivenInterceptor()

      Deprecated.

  - ### Method Detail

    - #### setObjectFactory

          public void setObjectFactory(ObjectFactory factory)

      Deprecated.

    - #### resolveModel

          protected Object resolveModel(ObjectFactory factory,
                                        ActionContext actionContext,
                                        String modelClassName,
                                        String modelScope,
                                        String modelName)
                                 throws Exception

      Deprecated.
      Throws:
        `Exception`

    - #### 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`

    - #### setClassName

          public void setClassName(String className)

      Deprecated.
      Parameters:
        `className` - the className to set

    - #### setName

          public void setName(String name)

      Deprecated.
      Parameters:
        `name` - the name to set

    - #### setScope

          public void setScope(String scope)

      Deprecated.
      Parameters:
        `scope` - the scope to set

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