|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
public class GrailsWebRequest
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()
Field Summary | |
---|---|
static String |
ID_PARAMETER
|
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 |
---|
REFERENCE_REQUEST, REFERENCE_SESSION, SCOPE_GLOBAL_SESSION, SCOPE_REQUEST, SCOPE_SESSION |
Constructor Summary | |
---|---|
GrailsWebRequest(HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
|
Method Summary | |
---|---|
void |
addParameterListener(ParameterCreationListener creationListener)
Adds a creationListener that will be called when the parameters are created |
String |
getActionName()
|
ApplicationContext |
getApplicationContext()
Obtains the ApplicationContext object |
GrailsApplicationAttributes |
getAttributes()
|
String |
getContextPath()
Retuns the context path of the request |
String |
getControllerName()
|
HttpServletRequest |
getCurrentRequest()
|
HttpServletResponse |
getCurrentResponse()
|
FlashScope |
getFlashScope()
|
String |
getId()
|
Writer |
getOut()
|
Map |
getParameterMap()
Overriden to return the GrailsParameterMap instance |
org.codehaus.groovy.grails.web.servlet.mvc.GrailsParameterMap |
getParams()
|
PropertyEditorRegistry |
getPropertyEditorRegistry()
Obtains the PropertyEditorRegistry instance |
ServletContext |
getServletContext()
|
GrailsHttpSession |
getSession()
|
void |
informParameterCreationListeners()
Informs any parameter creation listeners |
boolean |
isFlowRequest()
Returns true if the current executing request is a flow request |
boolean |
isRenderView()
|
static GrailsWebRequest |
lookup(HttpServletRequest request)
Looks up the GrailsWebRequest from the current request |
void |
setActionName(String actionName)
|
void |
setControllerName(String controllerName)
|
void |
setId(Object id)
Sets the id of the request |
void |
setOut(Writer out)
|
void |
setRenderView(boolean renderView)
|
Methods inherited from class org.springframework.web.servlet.handler.DispatcherServletWebRequest |
---|
getLocale |
Methods inherited from class org.springframework.web.context.request.ServletWebRequest |
---|
checkNotModified, getDescription, getHeader, getHeaderNames, getHeaderValues, getNativeRequest, getNativeRequest, getNativeResponse, getNativeResponse, getParameter, getParameterNames, 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, registerSessionDestructionCallback, removeAttribute, resolveReference, setAttribute, updateAccessedSessionAttributes |
Methods inherited from class org.springframework.web.context.request.AbstractRequestAttributes |
---|
isRequestActive, 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, resolveReference, setAttribute |
Field Detail |
---|
public static final String ID_PARAMETER
Constructor Detail |
---|
public GrailsWebRequest(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
Method Detail |
---|
public Map getParameterMap()
getParameterMap
in interface WebRequest
getParameterMap
in class ServletWebRequest
public Writer getOut()
public void setOut(Writer out)
out
- the out to setpublic ServletContext getServletContext()
public String getContextPath()
getContextPath
in interface WebRequest
getContextPath
in class ServletWebRequest
public FlashScope getFlashScope()
public HttpServletRequest getCurrentRequest()
public HttpServletResponse getCurrentResponse()
public org.codehaus.groovy.grails.web.servlet.mvc.GrailsParameterMap getParams()
public void informParameterCreationListeners()
public GrailsHttpSession getSession()
public GrailsApplicationAttributes getAttributes()
public void setActionName(String actionName)
public void setControllerName(String controllerName)
public String getActionName()
public String getControllerName()
public void setRenderView(boolean renderView)
public boolean isRenderView()
public String getId()
public boolean isFlowRequest()
public void addParameterListener(ParameterCreationListener creationListener)
ParameterInitializationCallback
addParameterListener
in interface ParameterInitializationCallback
creationListener
- The creationListenerpublic ApplicationContext getApplicationContext()
public PropertyEditorRegistry getPropertyEditorRegistry()
public static GrailsWebRequest lookup(HttpServletRequest request)
request
- The current request
public void setId(Object id)
id
- The id
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |