|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object grails.util.GrailsWebUtil
@SuppressWarnings("rawtypes") public class GrailsWebUtil extends java.lang.Object
Utility methods for clients using the web framework.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_ENCODING
|
Method Summary | |
---|---|
static GrailsWebRequest
|
bindMockWebRequest(org.springframework.web.context.WebApplicationContext ctx)
Binds a Mock implementation of a GrailsWebRequest object to the current thread. |
static GrailsWebRequest
|
bindMockWebRequest(org.springframework.web.context.WebApplicationContext ctx, org.springframework.mock.web.MockHttpServletRequest request, MockHttpServletResponse response)
Binds a Mock implementation of a GrailsWebRequest object to the current thread. |
static GrailsWebRequest
|
bindMockWebRequest()
Binds a Mock implementation of a GrailsWebRequest object to the current thread. |
static GrailsApplication
|
currentApplication()
@return The currently bound GrailsApplication instance |
static java.util.Map
|
currentConfiguration()
@return The currently bound GrailsApplication instance |
static java.util.Map
|
currentFlatConfiguration()
@return The currently bound GrailsApplication instance |
static java.lang.String
|
getContentType(java.lang.String name, java.lang.String encoding)
|
static groovy.lang.GroovyObject
|
getControllerFromRequest(javax.servlet.http.HttpServletRequest request)
Obtains the currently executing controller from the given request if any. |
static java.lang.String
|
getUriFromRequest(javax.servlet.http.HttpServletRequest request)
Retrieves the URI from the request from either the include attribute or the request.getRequestURI() method. |
static GrailsApplication
|
lookupApplication(javax.servlet.ServletContext servletContext)
Looks up a GrailsApplication instance from the ServletContext. |
Methods inherited from class java.lang.Object | |
---|---|
java.lang.Object#wait(), java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
Field Detail |
---|
public static final java.lang.String DEFAULT_ENCODING
Method Detail |
---|
public static GrailsWebRequest bindMockWebRequest(org.springframework.web.context.WebApplicationContext ctx)
ctx
- The WebApplicationContext to use
public static GrailsWebRequest bindMockWebRequest(org.springframework.web.context.WebApplicationContext ctx, org.springframework.mock.web.MockHttpServletRequest request, MockHttpServletResponse response)
ctx
- The WebApplicationContext to userequest
- The requestresponse
- The response
public static GrailsWebRequest bindMockWebRequest()
public static GrailsApplication currentApplication()
public static java.util.Map currentConfiguration()
public static java.util.Map currentFlatConfiguration()
public static java.lang.String getContentType(java.lang.String name, java.lang.String encoding)
public static groovy.lang.GroovyObject getControllerFromRequest(javax.servlet.http.HttpServletRequest request)
request
- The request object
public static java.lang.String getUriFromRequest(javax.servlet.http.HttpServletRequest request)
request
- The HttpServletRequest instance
public static GrailsApplication lookupApplication(javax.servlet.ServletContext servletContext)
servletContext
- The ServletContext
Groovy Documentation