ActionContext
instead.@Deprecated public class ActionContext extends ActionContext
The ActionContext is the context in which an Action
is executed. Each context is basically a
container of objects an action needs for execution like the session, parameters, locale, etc.
The ActionContext is thread local which means that values stored in the ActionContext are
unique per thread. See the ThreadLocal
class for more information. The benefit of
this is you don't need to worry about a user specific action context, you just get it:
ActionContext context = ActionContext.getContext();
Finally, because of the thread local usage you don't need to worry about making your actions thread safe.
Modifier and Type | Method and Description |
---|---|
static ActionContext |
adapt(ActionContext actualContext)
Deprecated.
|
ActionContext |
bind()
Deprecated.
Binds this context with the current thread
|
static ActionContext |
bind(ActionContext actionContext)
Deprecated.
|
static void |
clear()
Deprecated.
|
static boolean |
containsValueStack(Map<String,Object> context)
Deprecated.
|
Object |
get(String key)
Deprecated.
Returns a value that is stored in the current ActionContext by doing a lookup using the value's key.
|
ActionInvocation |
getActionInvocation()
Deprecated.
Gets the action invocation (the execution state).
|
ActionMapping |
getActionMapping()
Deprecated.
Gets ActionMapping associated with current action
|
String |
getActionName()
Deprecated.
Gets the name of the current Action.
|
Map<String,Object> |
getApplication()
Deprecated.
Returns a Map of the ServletContext when in a servlet environment or a generic application level Map otherwise.
|
Container |
getContainer()
Deprecated.
Sets the container for this request
|
static ActionContext |
getContext()
Deprecated.
|
Map<String,Object> |
getContextMap()
Deprecated.
Gets the context map.
|
Map<String,ConversionData> |
getConversionErrors()
Deprecated.
Gets the map of conversion errors which occurred when executing the action.
|
<T> T |
getInstance(Class<T> type)
Deprecated.
|
Locale |
getLocale()
Deprecated.
Gets the Locale of the current action.
|
javax.servlet.jsp.PageContext |
getPageContext()
Deprecated.
Gets PageContext associated with current action
|
HttpParameters |
getParameters()
Deprecated.
Returns a Map of the HttpServletRequest parameters when in a servlet environment or a generic Map of
parameters otherwise.
|
javax.servlet.ServletContext |
getServletContext()
Deprecated.
Gets ServletContext associated with current action
|
javax.servlet.http.HttpServletRequest |
getServletRequest()
Deprecated.
Gets ServletRequest associated with current action
|
javax.servlet.http.HttpServletResponse |
getServletResponse()
Deprecated.
Gets ServletResponse associated with current action
|
Map<String,Object> |
getSession()
Deprecated.
Gets the Map of HttpSession values when in a servlet environment or a generic session map otherwise.
|
ValueStack |
getValueStack()
Deprecated.
Gets the OGNL value stack.
|
static ActionContext |
of()
Deprecated.
|
static ActionContext |
of(Map<String,Object> context)
Deprecated.
|
void |
put(String key,
Object value)
Deprecated.
Stores a value in the current ActionContext.
|
ActionContext |
with(String key,
Object value)
Deprecated.
Adds arbitrary key to action context
|
ActionContext |
withActionInvocation(ActionInvocation actionInvocation)
Deprecated.
|
ActionContext |
withActionInvocation(ActionInvocation actionInvocation)
Deprecated.
Sets the action invocation (the execution state).
|
ActionContext |
withActionMapping(ActionMapping actionMapping)
Deprecated.
Assigns ActionMapping to action context
|
ActionContext |
withActionName(String actionName)
Deprecated.
Sets the name of the current Action in the ActionContext.
|
ActionContext |
withApplication(Map<String,Object> application)
Deprecated.
Sets the action's application context.
|
ActionContext |
withContainer(Container container)
Deprecated.
Gets the container for this request
|
ActionContext |
withConversionErrors(Map<String,ConversionData> conversionErrors)
Deprecated.
Sets conversion errors which occurred when executing the action.
|
ActionContext |
withExtraContext(Map<String,Object> extraContext)
Deprecated.
Assigns an extra context map to action context
|
ActionContext |
withLocale(Locale locale)
Deprecated.
Sets the Locale for the current action.
|
ActionContext |
withPageContext(javax.servlet.jsp.PageContext pageContext)
Deprecated.
Assigns PageContext to action context
|
ActionContext |
withParameters(HttpParameters parameters)
Deprecated.
Sets the action parameters.
|
ActionContext |
withServletContext(javax.servlet.ServletContext servletContext)
Deprecated.
Assigns ServletContext to action context
|
ActionContext |
withServletRequest(javax.servlet.http.HttpServletRequest request)
Deprecated.
Assigns ServletRequest to action context
|
ActionContext |
withServletResponse(javax.servlet.http.HttpServletResponse response)
Deprecated.
Assigns ServletResponse to action context
|
ActionContext |
withSession(Map<String,Object> session)
Deprecated.
Sets a map of action session values.
|
ActionContext |
withValueStack(ValueStack valueStack)
Deprecated.
|
ActionContext |
withValueStack(ValueStack valueStack)
Deprecated.
Sets the OGNL value stack.
|
equals, hashCode
public static ActionContext adapt(ActionContext actualContext)
public static ActionContext of(Map<String,Object> context)
public static ActionContext of()
public static ActionContext bind(ActionContext actionContext)
public static void clear()
public static ActionContext getContext()
public ActionContext bind()
ActionContext
bind
in class ActionContext
public ActionContext withActionInvocation(ActionInvocation actionInvocation)
public ActionContext withActionInvocation(ActionInvocation actionInvocation)
ActionContext
withActionInvocation
in class ActionContext
actionInvocation
- the action execution state.public ActionInvocation getActionInvocation()
ActionContext
getActionInvocation
in class ActionContext
public ActionContext withApplication(Map<String,Object> application)
ActionContext
withApplication
in class ActionContext
application
- the action's application context.public Map<String,Object> getApplication()
ActionContext
getApplication
in class ActionContext
public Map<String,Object> getContextMap()
ActionContext
getContextMap
in class ActionContext
public ActionContext withConversionErrors(Map<String,ConversionData> conversionErrors)
ActionContext
withConversionErrors
in class ActionContext
conversionErrors
- a Map of errors which occurred when executing the action.public Map<String,ConversionData> getConversionErrors()
ActionContext
getConversionErrors
in class ActionContext
public ActionContext withLocale(Locale locale)
ActionContext
withLocale
in class ActionContext
locale
- the Locale for the current action.public Locale getLocale()
ActionContext
default locale
is used.getLocale
in class ActionContext
public ActionContext withActionName(String actionName)
ActionContext
withActionName
in class ActionContext
actionName
- the name of the current action.public String getActionName()
ActionContext
getActionName
in class ActionContext
public ActionContext withParameters(HttpParameters parameters)
ActionContext
withParameters
in class ActionContext
parameters
- the parameters for the current action.public HttpParameters getParameters()
ActionContext
getParameters
in class ActionContext
public ActionContext withSession(Map<String,Object> session)
ActionContext
withSession
in class ActionContext
session
- the session values.public Map<String,Object> getSession()
ActionContext
getSession
in class ActionContext
public ActionContext withValueStack(ValueStack valueStack)
public ActionContext withValueStack(ValueStack valueStack)
ActionContext
withValueStack
in class ActionContext
valueStack
- the OGNL value stack.public ValueStack getValueStack()
ActionContext
getValueStack
in class ActionContext
public ActionContext withContainer(Container container)
ActionContext
withContainer
in class ActionContext
container
- The containerpublic Container getContainer()
ActionContext
getContainer
in class ActionContext
public <T> T getInstance(Class<T> type)
getInstance
in class ActionContext
public Object get(String key)
ActionContext
get
in class ActionContext
key
- the key used to find the value.public void put(String key, Object value)
ActionContext
put
in class ActionContext
key
- the key of the value.value
- the value to be stored.public javax.servlet.ServletContext getServletContext()
ActionContext
getServletContext
in class ActionContext
public ActionContext withServletContext(javax.servlet.ServletContext servletContext)
ActionContext
withServletContext
in class ActionContext
servletContext
- associated with current requestpublic javax.servlet.http.HttpServletRequest getServletRequest()
ActionContext
getServletRequest
in class ActionContext
public ActionContext withServletRequest(javax.servlet.http.HttpServletRequest request)
ActionContext
withServletRequest
in class ActionContext
request
- associated with current requestpublic javax.servlet.http.HttpServletResponse getServletResponse()
ActionContext
getServletResponse
in class ActionContext
public ActionContext withServletResponse(javax.servlet.http.HttpServletResponse response)
ActionContext
withServletResponse
in class ActionContext
response
- associated with current requestpublic javax.servlet.jsp.PageContext getPageContext()
ActionContext
getPageContext
in class ActionContext
public ActionContext withPageContext(javax.servlet.jsp.PageContext pageContext)
ActionContext
withPageContext
in class ActionContext
pageContext
- associated with current requestpublic ActionMapping getActionMapping()
ActionContext
getActionMapping
in class ActionContext
public ActionContext withActionMapping(ActionMapping actionMapping)
ActionContext
withActionMapping
in class ActionContext
actionMapping
- associated with current requestpublic ActionContext withExtraContext(Map<String,Object> extraContext)
ActionContext
withExtraContext
in class ActionContext
extraContext
- to add to the current action contextpublic ActionContext with(String key, Object value)
ActionContext
with
in class ActionContext
key
- a stringvalue
- an objectCopyright © 2000–2025 Apache Software Foundation. All rights reserved.