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, RequestAttributes, WebRequest
public class GrailsWebRequest
- extends 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
Methods inherited from class org.springframework.web.context.request.ServletWebRequest |
checkNotModified, getContextPath, getDescription, getParameter, getParameterValues, getRemoteUser, getUserPrincipal, isNotModified, isSecure, isUserInRole, toString |
ID_PARAMETER
public static final String ID_PARAMETER
- See Also:
- Constant Field Values
GrailsWebRequest
public GrailsWebRequest(HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
getParameterMap
public Map getParameterMap()
- Overriden to return the GrailsParameterMap instance
- Specified by:
getParameterMap
in interface WebRequest
- Overrides:
getParameterMap
in class ServletWebRequest
- Returns:
- An instance of GrailsParameterMap
getOut
public Writer getOut()
- Returns:
- the out
setOut
public void setOut(Writer out)
- Parameters:
out
- the out to set
getServletContext
public ServletContext getServletContext()
- Returns:
- The ServletContext instance
getFlashScope
public FlashScope getFlashScope()
- Returns:
- The FlashScope instance for the current request
getCurrentRequest
public HttpServletRequest getCurrentRequest()
- Returns:
- The currently executing request
getCurrentResponse
public 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(String actionName)
setControllerName
public void setControllerName(String controllerName)
getActionName
public String getActionName()
- Returns:
- the actionName
getControllerName
public 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 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 ApplicationContext getApplicationContext()
- Obtains the ApplicationContext object
- Returns:
- The ApplicationContext
Copyright (c) 2005-2006 The Grails project