|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.struts.chain.contexts.ContextWrapper
org.apache.struts.chain.contexts.ActionContextBase
org.apache.struts.chain.contexts.WebActionContext
org.apache.struts.chain.contexts.ServletActionContext
public class ServletActionContext
Implement ActionContext interface while making Servlet API-specific values available.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Field Summary |
|---|
| Fields inherited from class org.apache.struts.chain.contexts.ActionContextBase |
|---|
ACTION_CONFIG_KEY, ACTION_FORM_KEY, ACTION_KEY, CANCEL_KEY, ERROR_ACTION_MESSAGES_KEY, EXCEPTION_KEY, FORWARD_CONFIG_KEY, INCLUDE_KEY, LOCALE_KEY, MESSAGE_ACTION_MESSAGES_KEY, MESSAGE_RESOURCES_KEY, MODULE_CONFIG_KEY, token, TOKEN_KEY, TRANSACTION_TOKEN_KEY, VALID_KEY |
| Fields inherited from interface org.apache.struts.chain.contexts.ActionContext |
|---|
APPLICATION_SCOPE, REQUEST_SCOPE, SESSION_SCOPE |
| Constructor Summary | |
|---|---|
ServletActionContext(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Instantiate this Context for a given ServletContext, HttpServletRequest, and HttpServletResponse. |
|
ServletActionContext(org.apache.commons.chain.web.servlet.ServletWebContext context)
Instantiate this composite by wrapping a ServletWebContext. |
|
| Method Summary | |
|---|---|
void |
addErrors(ActionMessages errors)
Append the given errors keys to an internal cache, creating the cache if one is not already present. |
void |
addMessages(ActionMessages messages)
Append the given messages keys to an internal cache, creating the cache if one is not already present. |
java.lang.String |
generateToken()
Generate a new transaction token, to be used for enforcing a single request for a particular transaction. |
ActionServlet |
getActionServlet()
Return the ActionServlet for this context. |
javax.servlet.ServletContext |
getContext()
Return the ServletContext for this context. |
ActionMessages |
getErrors()
Retrieve error messages from an internal cache, creating an empty cache if one is not already present. |
MessageResources |
getMessageResources()
Return the default message resources for the current module. |
MessageResources |
getMessageResources(java.lang.String key)
Return the specified message resources for the current module. |
ActionMessages |
getMessages()
Retrieve messages from an internal cache, creating an empty cache if one is not already present. |
javax.servlet.http.HttpServletRequest |
getRequest()
Return the HttpServletRequest for this context. |
javax.servlet.http.HttpServletResponse |
getResponse()
Return the HttpServletResponse for this context. |
boolean |
isTokenValid(boolean reset)
Indicate whether a transaction token is stored in the "session" scope for this context, optionally clearing the token, so that the next check would return false. |
void |
release()
Signal to the instance that it will not be used any more, so that any resources which should be cleaned up can be cleaned up. |
void |
resetToken()
Clear any transactional token stored in the "session" scope for this context, so that the next check would return false. |
void |
saveErrors(ActionMessages errors)
Save the given error messages to the internal cache, clearing any previous messages in the cache. |
void |
saveMessages(ActionMessages messages)
Save the given messages to the internal cache, clearing any previous messages in the cache. |
void |
saveToken()
Save a new transaction token in the "session" scope for this context, creating new resources, if needed. |
protected org.apache.commons.chain.web.servlet.ServletWebContext |
servletWebContext()
Provide the ServletWebContext for this composite. |
void |
setActionConfig(ActionConfig actionConfig)
Set the ActionConfig class contains the details for processing this request. |
void |
setActionServlet(ActionServlet servlet)
Set the ActionServlet instance for this context. |
void |
setMessageResources(MessageResources resources)
Set the default message resources for the current module. |
void |
setMessageResources(java.lang.String key,
MessageResources resources)
Store the mesasage resources for the current module under the given request attribute key. |
| Methods inherited from class org.apache.struts.chain.contexts.WebActionContext |
|---|
getApplicationScope, getCancelled, getHeader, getHeaderValues, getInitParam, getModuleConfig, getParam, getParameterMap, getParamValues, getRequestScope, getSessionScope, setCancelled, setModuleConfig, webContext |
| Methods inherited from class org.apache.struts.chain.contexts.ActionContextBase |
|---|
addActionMessages, findOrCreateActionForm, findOrCreateActionForm, getAction, getActionConfig, getActionForm, getException, getFormValid, getForwardConfig, getInclude, getLocale, getLogger, getScope, getTokenGeneratorId, isTokenValid, saveActionMessages, saveActionMessages, saveMessages, setAction, setActionForm, setException, setFormValid, setForwardConfig, setInclude, setLocale, setLogger |
| Methods inherited from class org.apache.struts.chain.contexts.ContextWrapper |
|---|
clear, containsKey, containsValue, entrySet, get, getBaseContext, isEmpty, keySet, put, putAll, remove, size, values |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
| Constructor Detail |
|---|
public ServletActionContext(org.apache.commons.chain.web.servlet.ServletWebContext context)
Instantiate this composite by wrapping a ServletWebContext.
context - The ServletWebContext to wrap
public ServletActionContext(javax.servlet.ServletContext context,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Instantiate this Context for a given ServletContext, HttpServletRequest, and HttpServletResponse.
context - The instant ServletContextrequest - The instant HttpServletRequestresponse - The instant HttpServletResponse| Method Detail |
|---|
protected org.apache.commons.chain.web.servlet.ServletWebContext servletWebContext()
Provide the ServletWebContext for this composite.
public void release()
ActionContext
release in interface ActionContextrelease in class WebActionContextpublic javax.servlet.ServletContext getContext()
Return the ServletContext for this context.
public javax.servlet.http.HttpServletRequest getRequest()
Return the HttpServletRequest for this context.
public javax.servlet.http.HttpServletResponse getResponse()
Return the HttpServletResponse for this context.
public ActionServlet getActionServlet()
Return the ActionServlet for this context.
public void setActionServlet(ActionServlet servlet)
Set the ActionServlet instance for this context.
servlet - Our ActionServlet instancepublic void setActionConfig(ActionConfig actionConfig)
ActionContextSet the ActionConfig class contains the details for processing this request.
setActionConfig in interface ActionContextsetActionConfig in class ActionContextBaseactionConfig - The ActionConfig class to use with this requestpublic MessageResources getMessageResources()
ActionContextReturn the default message resources for the current module.
getMessageResources in interface ActionContextgetMessageResources in class ActionContextBasepublic MessageResources getMessageResources(java.lang.String key)
ActionContextReturn the specified message resources for the current module.
getMessageResources in interface ActionContextgetMessageResources in class ActionContextBasekey - The key specified in the <message-resources>
element for the requested bundlepublic void setMessageResources(MessageResources resources)
ActionContextSet the default message resources for the current module.
setMessageResources in interface ActionContextsetMessageResources in class ActionContextBase
public void setMessageResources(java.lang.String key,
MessageResources resources)
Store the mesasage resources for the current module under the given request attribute key.
key - Request attribute keyresources - Message resouces to storepublic void saveErrors(ActionMessages errors)
ActionContextSave the given error messages to the internal cache, clearing any previous messages in the cache.
If the parameter is null or empty, the internal cache is removed.
saveErrors in interface ActionContextsaveErrors in class ActionContextBaseerrors - ActionMesssages to cache as errorspublic void saveMessages(ActionMessages messages)
ActionContextSave the given messages to the internal cache, clearing any previous messages in the cache.
If the parameter is null or empty, the internal cache is removed.
saveMessages in interface ActionContextsaveMessages in class ActionContextBasemessages - ActionMesssages to cachepublic void addMessages(ActionMessages messages)
ActionContextAppend the given messages keys to an internal cache, creating the cache if one is not already present.
addMessages in interface ActionContextaddMessages in class ActionContextBasemessages - New ActionMessages to cachepublic void addErrors(ActionMessages errors)
ActionContextAppend the given errors keys to an internal cache, creating the cache if one is not already present.
addErrors in interface ActionContextaddErrors in class ActionContextBaseerrors - New ActionMessages to cache as errorspublic ActionMessages getErrors()
ActionContextRetrieve error messages from an internal cache, creating an empty cache if one is not already present.
getErrors in interface ActionContextgetErrors in class ActionContextBasepublic ActionMessages getMessages()
ActionContextRetrieve messages from an internal cache, creating an empty cache if one is not already present.
getMessages in interface ActionContextgetMessages in class ActionContextBasepublic void saveToken()
ActionContextSave a new transaction token in the "session" scope for this context, creating new resources, if needed.
saveToken in interface ActionContextsaveToken in class ActionContextBasepublic java.lang.String generateToken()
ActionContextGenerate a new transaction token, to be used for enforcing a single request for a particular transaction.
generateToken in interface ActionContextgenerateToken in class ActionContextBasepublic boolean isTokenValid(boolean reset)
ActionContextIndicate whether a transaction token is stored in the "session" scope for this context, optionally clearing the token, so that the next check would return false.
isTokenValid in interface ActionContextisTokenValid in class ActionContextBasereset - On true, clear the transactional tokenpublic void resetToken()
ActionContextClear any transactional token stored in the "session" scope for this context, so that the next check would return false.
resetToken in interface ActionContextresetToken in class ActionContextBase
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||