|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwebwork.action.ActionContext
Handles the context of each invoked action while providing an abstraction layer for both servlet and non servlet based applications.
Information is associated with the action's thread so it can be accessed from anywhere by calling a static method.
The context is initially set by the dispatcher.
ServletDispatcher
,
ClientServletDispatcher
Field Summary | |
static java.lang.String |
ACTION_NAME
|
static java.lang.String |
APPLICATION
|
static java.lang.String |
LOCALE
|
static java.lang.String |
PARAMETERS
|
static java.lang.String |
PRINCIPAL
|
static java.lang.String |
SESSION
|
static java.lang.String |
SINGLE_VALUE_PARAMETERS
|
Constructor Summary | |
ActionContext()
|
Method Summary | |
java.lang.Object |
get(java.lang.Object key)
Returns a value that is stored in the current ActionContext buy doing a lookup using the value's key. |
static java.util.Map |
getApplication()
Returns a Map of the ServletContext when in a servlet environment or a generic application level Map otherwise. |
java.util.Map |
getApplicationImpl()
|
static ActionContext |
getContext()
Returns the ActionContext specific to the current thread. |
static java.util.Locale |
getLocale()
Returns the Locale of the current request in a servlet environment or the default Locale in other environments. |
java.util.Locale |
getLocaleImpl()
|
static MultiPartRequestWrapper |
getMultiPartRequest()
Return multipart request for HttpServletRequest. |
MultiPartRequestWrapper |
getMultiPartRequestImpl()
|
static java.lang.String |
getName()
Returns the name of the current Action. |
java.lang.String |
getNameImpl()
|
static java.util.Map |
getParameters()
Returns a Map of the HttpServletRequest parameters when in a servlet environment or a generic Map of parameters otherwise. |
java.util.Map |
getParametersImpl()
|
static java.security.Principal |
getPrincipal()
Returns the current user's security Principal. |
java.security.Principal |
getPrincipalImpl()
|
static javax.servlet.http.HttpServletRequest |
getRequest()
Returns the HttpServletRequest object when in a servlet environment. |
javax.servlet.http.HttpServletRequest |
getRequestImpl()
|
static javax.servlet.http.HttpServletResponse |
getResponse()
Returns the HttpServletResponse when in a servlet environment. |
javax.servlet.http.HttpServletResponse |
getResponseImpl()
|
static javax.servlet.ServletContext |
getServletContext()
Returns the ServletContext when in a servlet environment. |
javax.servlet.ServletContext |
getServletContextImpl()
|
static java.util.Map |
getSession()
Returns the HttpSession when in a servlet environment or a generic session map otherwise. |
java.util.Map |
getSessionImpl()
|
static java.util.Map |
getSingleValueParameters()
Get the current ActionContext parameters. |
java.util.Map |
getSingleValueParametersImpl()
|
java.util.Map |
getTable()
|
static ValueStack |
getValueStack()
Returns the ValueStack specific to the current thread. |
ValueStack |
getValueStackImpl()
|
void |
put(java.lang.Object key,
java.lang.Object value)
Stores a value in the current ActionContext. |
static void |
setApplication(java.util.Map application)
Set an application level Map. |
void |
setApplicationImpl(java.util.Map application)
|
static void |
setContext(ActionContext aContext)
|
static void |
setLocale(java.util.Locale locale)
Set the current locale. |
void |
setLocaleImpl(java.util.Locale locale)
|
static void |
setName(java.lang.String name)
Stores the name of the current Action in the ActionContext. |
void |
setNameImpl(java.lang.String name)
|
static void |
setParameters(java.util.Map parameters)
Set a Map of parameters. |
void |
setParametersImpl(java.util.Map parameters)
|
static void |
setPrincipal(java.security.Principal principal)
Set the current user's security Principal. |
void |
setPrincipalImpl(java.security.Principal principal)
|
static void |
setRequest(javax.servlet.http.HttpServletRequest request)
Set the HttpServletRequest. |
void |
setRequestImpl(javax.servlet.http.HttpServletRequest request)
|
static void |
setResponse(javax.servlet.http.HttpServletResponse response)
Set the HttpServletResponse. |
void |
setResponseImpl(javax.servlet.http.HttpServletResponse response)
|
static void |
setServletContext(javax.servlet.ServletContext context)
Set the ServletContext. |
void |
setServletContextImpl(javax.servlet.ServletContext context)
|
static void |
setSession(java.util.Map session)
Set a session Map. |
void |
setSessionImpl(java.util.Map session)
|
static void |
setSingleValueParameters(java.util.Map parameters)
Set a Map of single value parameters. |
void |
setSingleValueParametersImpl(java.util.Map parameters)
|
void |
setTable(java.util.Map lookup)
|
static void |
setValueStack(ValueStack valueStack)
Set the ValueStack. |
void |
setValueStackImpl(ValueStack valueStack)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ACTION_NAME
public static final java.lang.String SESSION
public static final java.lang.String APPLICATION
public static final java.lang.String PARAMETERS
public static final java.lang.String SINGLE_VALUE_PARAMETERS
public static final java.lang.String LOCALE
public static final java.lang.String PRINCIPAL
Constructor Detail |
public ActionContext()
Method Detail |
public static void setContext(ActionContext aContext)
public static ActionContext getContext()
public java.util.Map getTable()
public void setTable(java.util.Map lookup)
public void put(java.lang.Object key, java.lang.Object value)
key
- The key of the value.value
- The value to be stored.public java.lang.Object get(java.lang.Object key)
key
- The key used to find the value.
public static java.lang.String getName()
public java.lang.String getNameImpl()
public static void setName(java.lang.String name)
name
- The name of the current action.public void setNameImpl(java.lang.String name)
public static java.util.Locale getLocale()
public java.util.Locale getLocaleImpl()
public static void setLocale(java.util.Locale locale)
locale
- current localepublic void setLocaleImpl(java.util.Locale locale)
public static java.util.Map getSession()
public java.util.Map getSessionImpl()
public static void setSession(java.util.Map session)
public void setSessionImpl(java.util.Map session)
public static java.util.Map getApplication()
public java.util.Map getApplicationImpl()
public static void setApplication(java.util.Map application)
public void setApplicationImpl(java.util.Map application)
public static java.util.Map getParameters()
public java.util.Map getParametersImpl()
public static void setParameters(java.util.Map parameters)
parameters
- The parameters for the current action context.public void setParametersImpl(java.util.Map parameters)
public static java.util.Map getSingleValueParameters()
public java.util.Map getSingleValueParametersImpl()
public static void setSingleValueParameters(java.util.Map parameters)
parameters
- for the current action context.public void setSingleValueParametersImpl(java.util.Map parameters)
public static java.security.Principal getPrincipal()
public java.security.Principal getPrincipalImpl()
public static void setPrincipal(java.security.Principal principal)
principal
- the current user's security Principalpublic void setPrincipalImpl(java.security.Principal principal)
public static MultiPartRequestWrapper getMultiPartRequest()
public MultiPartRequestWrapper getMultiPartRequestImpl()
public static javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.http.HttpServletRequest getRequestImpl()
public static void setRequest(javax.servlet.http.HttpServletRequest request)
public void setRequestImpl(javax.servlet.http.HttpServletRequest request)
public static javax.servlet.http.HttpServletResponse getResponse()
public javax.servlet.http.HttpServletResponse getResponseImpl()
public static void setResponse(javax.servlet.http.HttpServletResponse response)
public void setResponseImpl(javax.servlet.http.HttpServletResponse response)
public static javax.servlet.ServletContext getServletContext()
public javax.servlet.ServletContext getServletContextImpl()
public static void setServletContext(javax.servlet.ServletContext context)
public void setServletContextImpl(javax.servlet.ServletContext context)
public static ValueStack getValueStack()
public ValueStack getValueStackImpl()
public static void setValueStack(ValueStack valueStack)
valueStack
- public void setValueStackImpl(ValueStack valueStack)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |