com.scooterframework.web.controller
Class WebActionContext

java.lang.Object
  extended by com.scooterframework.web.controller.ActionContext
      extended by com.scooterframework.web.controller.WebActionContext

public class WebActionContext
extends ActionContext

WebActionContext class holds context data for current web request.


Field Summary
protected  javax.servlet.ServletContext servletContext
           
protected  javax.servlet.http.HttpServletRequest servletRequest
           
protected  javax.servlet.http.HttpServletResponse servletResponse
           
 
Fields inherited from class com.scooterframework.web.controller.ActionContext
errors, KEY_FLASH_MESSAGE, SCOPE_CONTEXT, SCOPE_GLOBAL, SCOPE_PARAMETER, SCOPE_REQUEST, SCOPE_SESSION, SCOPE_THREAD
 
Constructor Summary
WebActionContext(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse)
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Object> getContextDataAsMap()
          Gets data in context scope as a map.
protected  java.lang.Object getCycleFromCycleMap(java.lang.String name)
          Returns a named cycle from cycle map.
 java.lang.Object getFromContextData(java.lang.String key)
          Gets data represented by the key from the context scope.
 java.lang.Object getFromParameterData(java.lang.String key)
          Gets data represented by the key from the parameter scope.
 java.lang.Object getFromRequestData(java.lang.String key)
          Gets data represented by the key from the request scope.
 java.lang.Object getFromSessionData(java.lang.String key)
          Gets data represented by the key from the session scope.
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
          Retrieves the underlying Servlet Request.
 javax.servlet.http.HttpServletResponse getHttpServletResponse()
          Retrieves the underlying Servlet Response.
 java.util.Map<java.lang.String,java.lang.Object> getParameterDataAsMap()
          Gets data in parameter scope as a map.
 java.util.Map<java.lang.String,java.lang.Object> getRequestDataAsMap()
          Gets data in request scope as a map.
 java.util.Map<java.lang.String,java.lang.Object> getSessionDataAsMap()
          Gets data in session scope as a map.
 void removeAllSessionData()
          Removes all data represented by the key from session scope.
 void removeFromContextData(java.lang.String key)
          Removes data represented by the key from context scope.
 void removeFromRequestData(java.lang.String key)
          Removes data represented by the key from request scope.
 void removeFromSessionData(java.lang.String key)
          Removes data represented by the key from session scope.
protected  void setCycleToCycleMap(java.lang.String name, java.lang.Object cycle)
          Sets a named cycle in cycle map.
 void setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
          Sets the underlying Servlet Request.
 void setHttpServletResponse(javax.servlet.http.HttpServletResponse response)
          Sets the underlying Servlet Response.
 void storeToContext(java.lang.String key, java.lang.Object object)
          Stores the object represented by the key to context scope.
 void storeToRequest(java.lang.String key, java.lang.Object object)
          Stores the object represented by the key to request scope.
 void storeToSession(java.lang.String key, java.lang.Object object)
          Stores the object represented by the key to session scope.
 
Methods inherited from class com.scooterframework.web.controller.ActionContext
currentCycle, cycle, cycle, get, get, getAllFlashMessages, getAllRequestDataAsMap, getAllRequestDataAsMap, getError, getErrorAsMap, getFirstFlashMessage, getFromAllRequestData, getFromGlobalData, getFromParameterDataIgnoreCase, getFromThreadData, getGlobalDataAsMap, getGlobalLocale, getLatestFlashMessage, getLocale, getLocale, getParameterDataAsMap, getRequestDataAsMap, isRequiredField, remove, removeFromGlobalData, removeFromThreadData, resetCycle, resetFlashMessage, retrievePrimaryKeyDataMapFromRequest, retrievePrimaryKeyDataMapFromRequest, setError, setErrors, setFlashMessage, setFlashMessage, setGlobalLocale, setLocale, setRequestLocale, setSessionLocale, storeToGlobal, storeToThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

servletContext

protected javax.servlet.ServletContext servletContext

servletRequest

protected javax.servlet.http.HttpServletRequest servletRequest

servletResponse

protected javax.servlet.http.HttpServletResponse servletResponse
Constructor Detail

WebActionContext

public WebActionContext(javax.servlet.http.HttpServletRequest servletRequest,
                        javax.servlet.http.HttpServletResponse servletResponse)
Method Detail

setHttpServletRequest

public void setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
Sets the underlying Servlet Request.


getHttpServletRequest

public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Retrieves the underlying Servlet Request.

Returns:
HttpServletRequest

setHttpServletResponse

public void setHttpServletResponse(javax.servlet.http.HttpServletResponse response)
Sets the underlying Servlet Response.


getHttpServletResponse

public javax.servlet.http.HttpServletResponse getHttpServletResponse()
Retrieves the underlying Servlet Response.

Returns:
HttpServletResponse

getParameterDataAsMap

public java.util.Map<java.lang.String,java.lang.Object> getParameterDataAsMap()
Gets data in parameter scope as a map. The value corresponding to a key may either be a string or be a string array. Return guaranteed: An empty map will be returned if there is no data.

Specified by:
getParameterDataAsMap in class ActionContext
Returns:
Map

getRequestDataAsMap

public java.util.Map<java.lang.String,java.lang.Object> getRequestDataAsMap()
Gets data in request scope as a map. Data values with keys starting with "scooter." are excluded. Also excluded are sitemesh and Jetty related keys. Return guaranteed: An empty map will be returned if there is no data.

Specified by:
getRequestDataAsMap in class ActionContext
Returns:
Map

getSessionDataAsMap

public java.util.Map<java.lang.String,java.lang.Object> getSessionDataAsMap()
Gets data in session scope as a map. Return guaranteed: An empty map will be returned if there is no data.

Specified by:
getSessionDataAsMap in class ActionContext
Returns:
Map

getContextDataAsMap

public java.util.Map<java.lang.String,java.lang.Object> getContextDataAsMap()
Gets data in context scope as a map. Return guaranteed: An empty map will be returned if there is no data.

Specified by:
getContextDataAsMap in class ActionContext
Returns:
Map

getFromParameterData

public java.lang.Object getFromParameterData(java.lang.String key)
Gets data represented by the key from the parameter scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
getFromParameterData in class ActionContext
Parameters:
key -
Returns:
Object

getFromRequestData

public java.lang.Object getFromRequestData(java.lang.String key)
Gets data represented by the key from the request scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
getFromRequestData in class ActionContext
Parameters:
key -
Returns:
Object

getFromSessionData

public java.lang.Object getFromSessionData(java.lang.String key)
Gets data represented by the key from the session scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
getFromSessionData in class ActionContext
Parameters:
key -
Returns:
Object

getFromContextData

public java.lang.Object getFromContextData(java.lang.String key)
Gets data represented by the key from the context scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
getFromContextData in class ActionContext
Parameters:
key -
Returns:
Object

removeFromRequestData

public void removeFromRequestData(java.lang.String key)
Removes data represented by the key from request scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
removeFromRequestData in class ActionContext
Parameters:
key -

removeFromSessionData

public void removeFromSessionData(java.lang.String key)
Removes data represented by the key from session scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
removeFromSessionData in class ActionContext
Parameters:
key -

removeAllSessionData

public void removeAllSessionData()
Removes all data represented by the key from session scope.

Specified by:
removeAllSessionData in class ActionContext

removeFromContextData

public void removeFromContextData(java.lang.String key)
Removes data represented by the key from context scope. Note: The result of this method is sensitive to the case of key string.

Specified by:
removeFromContextData in class ActionContext
Parameters:
key -

storeToRequest

public void storeToRequest(java.lang.String key,
                           java.lang.Object object)
Stores the object represented by the key to request scope.

Specified by:
storeToRequest in class ActionContext
Parameters:
key - String
object - Object

storeToSession

public void storeToSession(java.lang.String key,
                           java.lang.Object object)
Stores the object represented by the key to session scope.

Specified by:
storeToSession in class ActionContext
Parameters:
key - String
object - Object

storeToContext

public void storeToContext(java.lang.String key,
                           java.lang.Object object)
Stores the object represented by the key to context scope.

Specified by:
storeToContext in class ActionContext
Parameters:
key - String
object - Object

getCycleFromCycleMap

protected java.lang.Object getCycleFromCycleMap(java.lang.String name)
Returns a named cycle from cycle map.

Specified by:
getCycleFromCycleMap in class ActionContext
Parameters:
name -
Returns:
cycle object

setCycleToCycleMap

protected void setCycleToCycleMap(java.lang.String name,
                                  java.lang.Object cycle)
Sets a named cycle in cycle map.

Specified by:
setCycleToCycleMap in class ActionContext
Parameters:
name -
cycle -