org.codehaus.groovy.grails.web.servlet.mvc
Class GrailsWebRequest
java.lang.Object
org.springframework.web.context.request.AbstractRequestAttributes
org.springframework.web.context.request.ServletRequestAttributes
org.springframework.web.context.request.ServletWebRequest
org.springframework.web.servlet.handler.DispatcherServletWebRequest
org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
- All Implemented Interfaces:
- ParameterInitializationCallback, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.context.request.RequestAttributes, org.springframework.web.context.request.WebRequest
public class GrailsWebRequest
- extends org.springframework.web.servlet.handler.DispatcherServletWebRequest
- implements ParameterInitializationCallback
A class the encapsulates a Grails request. An instance of this class is bound to the current thread using
Spring's RequestContextHolder which can later be retrieved using:
def webRequest = RequestContextHolder.currentRequestAttributes()
- Since:
- 0.4
- Author:
- Graeme Rocher
Fields inherited from class org.springframework.web.context.request.ServletRequestAttributes |
DESTRUCTION_CALLBACK_NAME_PREFIX |
Fields inherited from class org.springframework.web.context.request.AbstractRequestAttributes |
requestDestructionCallbacks |
Fields inherited from interface org.springframework.web.context.request.RequestAttributes |
SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION |
Constructor Summary |
GrailsWebRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext)
|
Methods inherited from class org.springframework.web.servlet.handler.DispatcherServletWebRequest |
getLocale |
Methods inherited from class org.springframework.web.context.request.ServletWebRequest |
checkNotModified, getContextPath, getDescription, getNativeRequest, getNativeResponse, getParameter, getParameterValues, getRemoteUser, getResponse, getUserPrincipal, isNotModified, isSecure, isUserInRole, toString |
Methods inherited from class org.springframework.web.context.request.ServletRequestAttributes |
getAttribute, getAttributeNames, getRequest, getSession, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, setAttribute, updateAccessedSessionAttributes |
Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributes |
registerRequestDestructionCallback, removeRequestDestructionCallback, requestCompleted |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.springframework.web.context.request.RequestAttributes |
getAttribute, getAttributeNames, getSessionId, getSessionMutex, registerDestructionCallback, removeAttribute, setAttribute |
ID_PARAMETER
public static final java.lang.String ID_PARAMETER
- See Also:
- Constant Field Values
GrailsWebRequest
public GrailsWebRequest(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.ServletContext servletContext)
getParameterMap
public java.util.Map getParameterMap()
- Overriden to return the GrailsParameterMap instance
- Specified by:
getParameterMap
in interface org.springframework.web.context.request.WebRequest
- Overrides:
getParameterMap
in class org.springframework.web.context.request.ServletWebRequest
- Returns:
- An instance of GrailsParameterMap
getOut
public java.io.Writer getOut()
- Returns:
- the out
setOut
public void setOut(java.io.Writer out)
- Parameters:
out
- the out to set
getServletContext
public javax.servlet.ServletContext getServletContext()
- Returns:
- The ServletContext instance
getFlashScope
public FlashScope getFlashScope()
- Returns:
- The FlashScope instance for the current request
getCurrentRequest
public javax.servlet.http.HttpServletRequest getCurrentRequest()
- Returns:
- The currently executing request
getCurrentResponse
public javax.servlet.http.HttpServletResponse getCurrentResponse()
getParams
public GrailsParameterMap getParams()
- Returns:
- The Grails params object
getSession
public GrailsHttpSession getSession()
- Returns:
- The Grails session object
getAttributes
public GrailsApplicationAttributes getAttributes()
- Returns:
- The GrailsApplicationAttributes instance
setActionName
public void setActionName(java.lang.String actionName)
setControllerName
public void setControllerName(java.lang.String controllerName)
getActionName
public java.lang.String getActionName()
- Returns:
- the actionName
getControllerName
public java.lang.String getControllerName()
- Returns:
- the controllerName
setRenderView
public void setRenderView(boolean renderView)
isRenderView
public boolean isRenderView()
- Returns:
- True if the view for this GrailsWebRequest should be rendered
getId
public java.lang.String getId()
isFlowRequest
public boolean isFlowRequest()
- Returns true if the current executing request is a flow request
- Returns:
- True if it is a flow request
addParameterListener
public void addParameterListener(ParameterCreationListener creationListener)
- Description copied from interface:
ParameterInitializationCallback
- Adds a creationListener that will be called when the parameters are created
- Specified by:
addParameterListener
in interface ParameterInitializationCallback
- Parameters:
creationListener
- The creationListener
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()
- Obtains the ApplicationContext object
- Returns:
- The ApplicationContext
Copyright (c) 2005-2006 The Grails project