com.opensymphony.xwork2.interceptor

## Class StaticParametersInterceptor

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

- All Implemented Interfaces:
    Serializable, ConditionalInterceptor, Interceptor

  Deprecated.
  since 6.7.0, use `StaticParametersInterceptor` instead.

      @Deprecated
      public class StaticParametersInterceptor
      extends AbstractInterceptor

  This interceptor populates the action with the static parameters defined in the action configuration. If the action implements `Parameterizable`, a map of the static parameters will be also be passed directly to the action. The static params will be added to the request params map, unless "merge" is set to false.

  Parameters are typically defined with <param> elements within xwork.xml.

  Interceptor parameters:

  - None

  Extending the interceptor:

  There are no extension points to this interceptor.

  Example code:

       <action name="someAction" class="com.examples.SomeAction">
           <interceptor-ref name="staticParams">
                <param name="parse">true</param>
                <param name="overwrite">false</param>
           </interceptor-ref>
           <result name="success">good_result.ftl</result>
       </action>

  Author:
    Patrick Lightbody
  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
    `StaticParametersInterceptor()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addParametersToContext(ActionContext ac, Map<String,?> newParams)` Deprecated. Adds the parameters into context's ParameterMap.
    `String` | `intercept(ActionInvocation invocation)` Deprecated. Override to handle interception
    `protected Map<String,String>` | `retrieveParameters(ActionContext ac)` Deprecated.
    `void` | `setDevMode(String mode)` Deprecated.
    `void` | `setLocalizedTextProvider(LocalizedTextProvider localizedTextProvider)` Deprecated.
    `void` | `setMerge(String value)` Deprecated.
    `void` | `setOverwrite(String value)` Deprecated. Overwrites already existing parameters from other sources.
    `void` | `setParse(String value)` Deprecated.
    `void` | `setValueStackFactory(ValueStackFactory valueStackFactory)` 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

    - #### StaticParametersInterceptor

          public StaticParametersInterceptor()

      Deprecated.

  - ### Method Detail

    - #### setValueStackFactory

          public void setValueStackFactory(ValueStackFactory valueStackFactory)

      Deprecated.

    - #### setDevMode

          public void setDevMode(String mode)

      Deprecated.

    - #### setLocalizedTextProvider

          public void setLocalizedTextProvider(LocalizedTextProvider localizedTextProvider)

      Deprecated.

    - #### setParse

          public void setParse(String value)

      Deprecated.

    - #### setMerge

          public void setMerge(String value)

      Deprecated.

    - #### setOverwrite

          public void setOverwrite(String value)

      Deprecated.
      Overwrites already existing parameters from other sources. Static parameters are the successor over previously set parameters, if true.
      Parameters:
        `value` - enable overwrites of already existing parameters from other sources

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

    - #### retrieveParameters

          protected Map<String,String> retrieveParameters(ActionContext ac)

      Deprecated.
      Parameters:
        `ac` - The action context
      Returns:
        the parameters from the action mapping in the context. If none found, returns an empty map.

    - #### addParametersToContext

          protected void addParametersToContext(ActionContext ac,
                                                Map<String,?> newParams)

      Deprecated.
      Adds the parameters into context's ParameterMap. As default, static parameters will not overwrite existing parameters from other sources. If you want the static parameters as successor over already existing parameters, set overwrite to `true`.
      Parameters:
        `ac` - The action context
        `newParams` - The parameter map to apply

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