|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.web.util.WebUtils
org.codehaus.groovy.grails.web.util.WebUtils
public class WebUtils
Utility methods to access commons objects and perform common web related functions for the internal framework
Field Summary | |
---|---|
static java.lang.String |
DISPATCH_ACTION_PARAMETER
|
static java.lang.String |
ENABLE_FILE_EXTENSIONS
|
static char |
SLASH
|
Fields inherited from class org.springframework.web.util.WebUtils |
---|
CONTENT_TYPE_CHARSET_PREFIX, DEFAULT_CHARACTER_ENCODING, DEFAULT_WEB_APP_ROOT_KEY, FORWARD_CONTEXT_PATH_ATTRIBUTE, FORWARD_PATH_INFO_ATTRIBUTE, FORWARD_QUERY_STRING_ATTRIBUTE, FORWARD_REQUEST_URI_ATTRIBUTE, FORWARD_SERVLET_PATH_ATTRIBUTE, HTML_ESCAPE_CONTEXT_PARAM, INCLUDE_CONTEXT_PATH_ATTRIBUTE, INCLUDE_PATH_INFO_ATTRIBUTE, INCLUDE_QUERY_STRING_ATTRIBUTE, INCLUDE_REQUEST_URI_ATTRIBUTE, INCLUDE_SERVLET_PATH_ATTRIBUTE, SESSION_MUTEX_ATTRIBUTE, SUBMIT_IMAGE_SUFFIXES, TEMP_DIR_CONTEXT_ATTRIBUTE, WEB_APP_ROOT_KEY_PARAM |
Constructor Summary | |
---|---|
WebUtils()
|
Method Summary | |
---|---|
static boolean |
areFileExtensionsEnabled()
Returns the value of the "grails.mime.file.extensions" setting configured in COnfig.groovy |
static java.lang.String |
buildDispatchUrlForMapping(UrlMappingInfo info)
Constructs the URI to forward to using the given request and UrlMappingInfo instance |
static void |
clearGrailsWebRequest()
Removes any GrailsWebRequest instance from the current request. |
static java.lang.String |
forwardRequestForUrlMappingInfo(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
UrlMappingInfo info)
|
static java.lang.String |
forwardRequestForUrlMappingInfo(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
UrlMappingInfo info,
java.util.Map model)
|
static java.lang.String |
getFormatFromURI(java.lang.String uri)
Obtains the format from the URI. |
static GrailsApplication |
lookupApplication(javax.servlet.ServletContext servletContext)
Looks up the GrailsApplication instance |
static UrlMappingsHolder |
lookupUrlMappings(javax.servlet.ServletContext servletContext)
Looks up the UrlMappingsHolder instance |
static org.springframework.web.servlet.ViewResolver |
lookupViewResolver(javax.servlet.ServletContext servletContext)
|
static org.springframework.web.servlet.View |
resolveView(javax.servlet.http.HttpServletRequest request,
java.lang.String viewName,
java.lang.String controllerName,
org.springframework.web.servlet.ViewResolver viewResolver)
Resolves a view for the given view name and controller name |
static org.springframework.web.servlet.View |
resolveView(javax.servlet.http.HttpServletRequest request,
UrlMappingInfo info,
java.lang.String viewName,
org.springframework.web.servlet.ViewResolver viewResolver)
Resolves a view for the given view and UrlMappingInfo instance |
static GrailsWebRequest |
retrieveGrailsWebRequest()
Returns the GrailsWebRequest associated with the current request. |
static void |
storeGrailsWebRequest(GrailsWebRequest webRequest)
Helper method to store the given GrailsWebRequest for the current request. |
Methods inherited from class org.springframework.web.util.WebUtils |
---|
exposeForwardRequestAttributes, exposeRequestAttributes, extractFilenameFromUrlPath, findParameterValue, findParameterValue, getCookie, getDefaultHtmlEscape, getOrCreateSessionAttribute, getParametersStartingWith, getRealPath, getRequiredSessionAttribute, getSessionAttribute, getSessionId, getSessionMutex, getTargetPage, getTempDir, hasSubmitParameter, isDefaultHtmlEscape, isIncludeRequest, removeWebAppRootSystemProperty, setSessionAttribute, setWebAppRootSystemProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char SLASH
public static final java.lang.String ENABLE_FILE_EXTENSIONS
public static final java.lang.String DISPATCH_ACTION_PARAMETER
Constructor Detail |
---|
public WebUtils()
Method Detail |
---|
public static org.springframework.web.servlet.ViewResolver lookupViewResolver(javax.servlet.ServletContext servletContext)
public static UrlMappingsHolder lookupUrlMappings(javax.servlet.ServletContext servletContext)
servletContext
- The ServletContext object
public static GrailsApplication lookupApplication(javax.servlet.ServletContext servletContext)
public static org.springframework.web.servlet.View resolveView(javax.servlet.http.HttpServletRequest request, UrlMappingInfo info, java.lang.String viewName, org.springframework.web.servlet.ViewResolver viewResolver) throws java.lang.Exception
request
- The requestinfo
- The infoviewName
- The view nameviewResolver
- The view resolver
java.lang.Exception
public static org.springframework.web.servlet.View resolveView(javax.servlet.http.HttpServletRequest request, java.lang.String viewName, java.lang.String controllerName, org.springframework.web.servlet.ViewResolver viewResolver) throws java.lang.Exception
request
- The requestviewName
- The view namecontrollerName
- The controller nameviewResolver
- The resolver
java.lang.Exception
- Thrown if an error occurspublic static java.lang.String buildDispatchUrlForMapping(UrlMappingInfo info)
info
- The UrlMappingInfo
public static java.lang.String forwardRequestForUrlMappingInfo(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, UrlMappingInfo info) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public static java.lang.String forwardRequestForUrlMappingInfo(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, UrlMappingInfo info, java.util.Map model) throws javax.servlet.ServletException, java.io.IOException
javax.servlet.ServletException
java.io.IOException
public static java.lang.String getFormatFromURI(java.lang.String uri)
uri
- The URI
public static boolean areFileExtensionsEnabled()
public static GrailsWebRequest retrieveGrailsWebRequest()
java.lang.IllegalStateException
- if this is called outside of a
request.public static void storeGrailsWebRequest(GrailsWebRequest webRequest)
public static void clearGrailsWebRequest()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |