Class MockActionContext

All Implemented Interfaces:
Map<String,Object>, Context, ActionContext

public class MockActionContext extends ActionContextBase

Implement ActionContext with empty maps for applicationScope, sessionScope, requestScope, and parameterMap properties.

  • Constructor Details

    • MockActionContext

      public MockActionContext()
  • Method Details

    • getApplicationScope

      public Map<String,Object> getApplicationScope()
      Description copied from interface: ActionContext

      Return a Map of Application scoped values.

      This is implemented in analogy with the Application scope in the Servlet API, but it seems reasonable to expect that any Struts implementation will have an equivalent concept.

      The ultimate meaning of "application scope" is an implementation detail left unspecified by Struts.

      Specified by:
      getApplicationScope in interface ActionContext
      Specified by:
      getApplicationScope in class ActionContextBase
      Returns:
      A Map of "application scope" attributes.
    • setApplicationScope

      public void setApplicationScope(Map<String,Object> applicationScope)
    • getParameterMap

      public Map<String,String[]> getParameterMap()
      Description copied from interface: ActionContext

      Return a Map of parameters submitted by the user as part of this request. The keys to this map will be request parameter names (of type String), and the values will be String[].

      This is implemented in analogy with the Request parameters of the Servlet API, but it seems reasonable to expect that any Struts implementation will have an equivalent concept.

      Returns:
      A map of the request parameter attributes
    • setParameterMap

      public void setParameterMap(Map<String,String[]> parameterMap)
    • getRequestScope

      public Map<String,Object> getRequestScope()
      Description copied from interface: ActionContext

      Return a Map of request scoped values. A request is understood as the fundamental motivation for any particular instance of an ActionContext.

      This is implemented in analogy with the Request Context in the Servlet API, but it seems reasonable to expect that any Struts implementation will have an equivalent concept.

      The ultimate meaning of "request scope" is an implementation detail left unspecified by Struts.

      Specified by:
      getRequestScope in interface ActionContext
      Specified by:
      getRequestScope in class ActionContextBase
      Returns:
      a Map of "request scope" attributes.
    • setRequestScope

      public void setRequestScope(Map<String,Object> requestScope)
    • getSessionScope

      public Map<String,Object> getSessionScope()
      Description copied from interface: ActionContext

      Return a Map of Session scoped values. A session is understood as a sequence of requests made by the same user.

      This is implemented in analogy with the Session scope in the Servlet API, but it seems reasonable to expect that any Struts implementation will have an equivalent concept.

      The ultimate meaning of "session scope" is an implementation detail left unspecified by Struts.

      Specified by:
      getSessionScope in interface ActionContext
      Specified by:
      getSessionScope in class ActionContextBase
      Returns:
      A Map of "session scope" attributes.
    • setSessionScope

      public void setSessionScope(Map<String,Object> sessionScope)