org.apache.struts2.views.velocity

## Class StrutsVelocityContext

- java.lang.Object
- - org.apache.velocity.context.AbstractContext
  - - org.apache.velocity.VelocityContext
    - - org.apache.struts2.views.velocity.StrutsVelocityContext

- All Implemented Interfaces:
    Serializable, Cloneable, ValueStackProvider, org.apache.velocity.context.Context, org.apache.velocity.context.InternalEventContext

      public class StrutsVelocityContext
      extends org.apache.velocity.VelocityContext
      implements ValueStackProvider

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StrutsVelocityContext(List<org.apache.velocity.VelocityContext> chainedContexts, ValueStack stack)` Creates a content with link to the ValueStack and any other Velocity contexts
    `StrutsVelocityContext(ValueStack stack)` Deprecated. please use `StrutsVelocityContext(List, ValueStack)` and pass {null} or empty list if no chained contexts were defined
    `StrutsVelocityContext(org.apache.velocity.VelocityContext[] chainedContexts, ValueStack stack)` Deprecated. please use `StrutsVelocityContext(List, ValueStack)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Object` | `chainedContextGet(String key)`
    `protected List<Function<String,Object>>` | `contextGetterList()`
    `ValueStack` | `getValueStack()`
    `boolean` | `internalContainsKey(String key)`
    `Object` | `internalGet(String key)`
    `protected Object` | `stackGet(String key)`
    `protected Object` | `superInternalGet(String key)`

    - ### Methods inherited from class org.apache.velocity.VelocityContext

      `clone, internalGetKeys, internalPut, internalRemove`

    - ### Methods inherited from class org.apache.velocity.context.AbstractContext

      `containsKey, get, getChainedContext, getKeys, put, remove`

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### StrutsVelocityContext

          public StrutsVelocityContext(List<org.apache.velocity.VelocityContext> chainedContexts,
                                       ValueStack stack)

      Creates a content with link to the ValueStack and any other Velocity contexts
      Parameters:
        `chainedContexts` - Existing Velocity contexts to chain to
        `stack` - Struts ValueStack
      Since:
        6.0.0

    - #### StrutsVelocityContext

          @Deprecated
          public StrutsVelocityContext(ValueStack stack)

      Deprecated. please use `StrutsVelocityContext(List, ValueStack)` and pass {null} or empty list if no chained contexts were defined

    - #### StrutsVelocityContext

          @Deprecated
          public StrutsVelocityContext(org.apache.velocity.VelocityContext[] chainedContexts,
                                                   ValueStack stack)

      Deprecated. please use `StrutsVelocityContext(List, ValueStack)`

  - ### Method Detail

    - #### internalContainsKey

          public boolean internalContainsKey(String key)

      Overrides:
        `internalContainsKey` in class `org.apache.velocity.VelocityContext`

    - #### internalGet

          public Object internalGet(String key)

      Overrides:
        `internalGet` in class `org.apache.velocity.VelocityContext`

    - #### contextGetterList

          protected List<Function<String,Object>> contextGetterList()

    - #### superInternalGet

          protected Object superInternalGet(String key)

    - #### stackGet

          protected Object stackGet(String key)

    - #### chainedContextGet

          protected Object chainedContextGet(String key)

    - #### getValueStack

          public ValueStack getValueStack()

      Specified by:
        `getValueStack` in interface `ValueStackProvider`

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