com.opensymphony.xwork2.interceptor

## Class AliasInterceptor

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

- All Implemented Interfaces:
    Serializable, ConditionalInterceptor, Interceptor

  Deprecated.
  since 6.7.0, use `AliasInterceptor` instead.

      @Deprecated
      public class AliasInterceptor
      extends AbstractInterceptor

  The aim of this Interceptor is to alias a named parameter to a different named parameter. By acting as the glue between actions sharing similar parameters (but with different names), it can help greatly with action chaining.

  Action's alias expressions should be in the form of `#{ "name1" : "alias1", "name2" : "alias2" }`. This means that assuming an action (or something else in the stack) has a value for the expression named name1 and the action this interceptor is applied to has a setter named alias1, alias1 will be set with the value from name1.

  Interceptor parameters:

  - aliasesKey (optional) - the name of the action parameter to look for the alias map (by default this is aliases).

  Extending the interceptor:

  This interceptor does not have any known extension points.

  Example code:

       <action name="someAction" class="com.examples.SomeAction">
           <!-- The value for the foo parameter will be applied as if it were named bar -->
           <param name="aliases">#{ 'foo' : 'bar' }</param>

           <interceptor-ref name="alias"/>
           <interceptor-ref name="basicStack"/>
           <result name="success">good_result.ftl</result>
       </action>

  Author:
    Matthew Payne
  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `ConditionalInterceptor.LegacyAdapter`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `aliasesKey` Deprecated.
    `protected boolean` | `devMode` Deprecated.
    `protected LocalizedTextProvider` | `localizedTextProvider` Deprecated.
    `protected ValueStackFactory` | `valueStackFactory` Deprecated.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AliasInterceptor()` 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 boolean` | `isAccepted(String paramName)` Deprecated.
    `protected boolean` | `isExcluded(String paramName)` Deprecated.
    `protected boolean` | `isNotAcceptableExpression(String expression)` Deprecated. Checks if expression contains vulnerable code
    `void` | `setAcceptedPatterns(AcceptedPatternsChecker acceptedPatterns)` Deprecated.
    `void` | `setAcceptParamNames(String commaDelim)` Deprecated. Sets a comma-delimited list of regular expressions to match parameters that are allowed in the parameter map (aka whitelist).
    `void` | `setAliasesKey(String aliasesKey)` Deprecated. Sets the name of the action parameter to look for the alias map.
    `void` | `setDevMode(String mode)` Deprecated.
    `void` | `setExcludedPatterns(ExcludedPatternsChecker excludedPatterns)` Deprecated.
    `void` | `setExcludeParams(String commaDelim)` Deprecated. Sets a comma-delimited list of regular expressions to match parameters that should be removed from the parameter map.
    `void` | `setLocalizedTextProvider(LocalizedTextProvider localizedTextProvider)` 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`

- - ### Field Detail

    - #### aliasesKey

          protected String aliasesKey

      Deprecated.

    - #### valueStackFactory

          protected ValueStackFactory valueStackFactory

      Deprecated.

    - #### localizedTextProvider

          protected LocalizedTextProvider localizedTextProvider

      Deprecated.

    - #### devMode

          protected boolean devMode

      Deprecated.

  - ### Constructor Detail

    - #### AliasInterceptor

          public AliasInterceptor()

      Deprecated.

  - ### Method Detail

    - #### setDevMode

          public void setDevMode(String mode)

      Deprecated.

    - #### setValueStackFactory

          public void setValueStackFactory(ValueStackFactory valueStackFactory)

      Deprecated.

    - #### setLocalizedTextProvider

          public void setLocalizedTextProvider(LocalizedTextProvider localizedTextProvider)

      Deprecated.

    - #### setExcludedPatterns

          public void setExcludedPatterns(ExcludedPatternsChecker excludedPatterns)

      Deprecated.

    - #### setAcceptedPatterns

          public void setAcceptedPatterns(AcceptedPatternsChecker acceptedPatterns)

      Deprecated.

    - #### setAliasesKey

          public void setAliasesKey(String aliasesKey)

      Deprecated.

      Sets the name of the action parameter to look for the alias map.

      Default is `aliases`.

      Parameters:
        `aliasesKey` - the name of the action parameter

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

    - #### isAccepted

          protected boolean isAccepted(String paramName)

      Deprecated.

    - #### isExcluded

          protected boolean isExcluded(String paramName)

      Deprecated.

    - #### isNotAcceptableExpression

          protected boolean isNotAcceptableExpression(String expression)

      Deprecated.
      Checks if expression contains vulnerable code
      Parameters:
        `expression` - of interceptor
      Returns:
        true|false

    - #### setAcceptParamNames

          public void setAcceptParamNames(String commaDelim)

      Deprecated.
      Sets a comma-delimited list of regular expressions to match parameters that are allowed in the parameter map (aka whitelist).

      Don't change the default unless you know what you are doing in terms of security implications.

      Parameters:
        `commaDelim` - A comma-delimited list of regular expressions

    - #### setExcludeParams

          public void setExcludeParams(String commaDelim)

      Deprecated.
      Sets a comma-delimited list of regular expressions to match parameters that should be removed from the parameter map.
      Parameters:
        `commaDelim` - A comma-delimited list of regular expressions

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