Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.codehaus.groovy.grails.web.util
Class WebUtils

    java.lang.Object
      org.springframework.web.util.WebUtils
          org.codehaus.groovy.grails.web.util.WebUtils

    public class WebUtils

extends WebUtils

Utility methods to access commons objects and perform common web related functions for the internal framework

Since:
  1.0

  Created: Oct 10, 2007
Author:
  Graeme Rocher

Field Summary
`static 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 String` | `buildDispatchUrlForMapping(UrlMappingInfo info)` Constructs the URI to forward to using the given request and UrlMappingInfo instance
`static String` | `forwardRequestForUrlMappingInfo(HttpServletRequest request, HttpServletResponse response, UrlMappingInfo info)`
`static String` | `forwardRequestForUrlMappingInfo(HttpServletRequest request, HttpServletResponse response, UrlMappingInfo info, Map model)`
`static String` | `getFormatFromURI(String uri)` Obtains the format from the URI.
`static GrailsApplication` | `lookupApplication(ServletContext servletContext)` Looks up the GrailsApplication instance
`static UrlMappingsHolder` | `lookupUrlMappings(ServletContext servletContext)` Looks up the UrlMappingsHolder instance
`static ViewResolver` | `lookupViewResolver(ServletContext servletContext)`
`static View` | `resolveView(HttpServletRequest request, String viewName, String controllerName, ViewResolver viewResolver)` Resolves a view for the given view name and controller name
`static View` | `resolveView(HttpServletRequest request, UrlMappingInfo info, String viewName, ViewResolver viewResolver)` Resolves a view for the given view and UrlMappingInfo instance

Methods inherited from class org.springframework.web.util.WebUtils
`exposeForwardRequestAttributes, exposeRequestAttributes, extractFilenameFromUrlPath, 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

### SLASH

    public static final char SLASH

See Also:
  Constant Field Values

### ENABLE_FILE_EXTENSIONS

    public static final String ENABLE_FILE_EXTENSIONS

See Also:
  Constant Field Values

Constructor Detail

### WebUtils

    public WebUtils()

Method Detail

### lookupViewResolver

    public static ViewResolver lookupViewResolver(ServletContext servletContext)

### lookupUrlMappings

    public static UrlMappingsHolder lookupUrlMappings(ServletContext servletContext)

  Looks up the UrlMappingsHolder instance

  Parameters:
    `servletContext` - The ServletContext object
  Returns:
    The UrlMappingsHolder

### lookupApplication

    public static GrailsApplication lookupApplication(ServletContext servletContext)

  Looks up the GrailsApplication instance

  Returns:
    The GrailsApplication instance

### resolveView

    public static View resolveView(HttpServletRequest request,
                                   UrlMappingInfo info,
                                   String viewName,
                                   ViewResolver viewResolver)
                            throws Exception

  Resolves a view for the given view and UrlMappingInfo instance

  Parameters:
    `request` - The request
    `info` - The info
    `viewName` - The view name
    `viewResolver` - The view resolver
  Returns:
    The view or null
  Throws:
    `Exception`

### resolveView

    public static View resolveView(HttpServletRequest request,
                                   String viewName,
                                   String controllerName,
                                   ViewResolver viewResolver)
                            throws Exception

  Resolves a view for the given view name and controller name

  Parameters:
    `request` - The request
    `viewName` - The view name
    `controllerName` - The controller name
    `viewResolver` - The resolver
  Returns:
    A View or null
  Throws:
    `Exception` - Thrown if an error occurs

### buildDispatchUrlForMapping

    public static String buildDispatchUrlForMapping(UrlMappingInfo info)

  Constructs the URI to forward to using the given request and UrlMappingInfo instance

  Parameters:
    `info` - The UrlMappingInfo
  Returns:
    The URI to forward to

### forwardRequestForUrlMappingInfo

    public static String forwardRequestForUrlMappingInfo(HttpServletRequest request,
                                                         HttpServletResponse response,
                                                         UrlMappingInfo info)
                                                  throws ServletException,
                                                         IOException

  Throws:
    `ServletException`
    `IOException`

### forwardRequestForUrlMappingInfo

    public static String forwardRequestForUrlMappingInfo(HttpServletRequest request,
                                                         HttpServletResponse response,
                                                         UrlMappingInfo info,
                                                         Map model)
                                                  throws ServletException,
                                                         IOException

  Throws:
    `ServletException`
    `IOException`

### getFormatFromURI

    public static String getFormatFromURI(String uri)

  Obtains the format from the URI. The format is the string following the . file extension in the last token of the URI

  Parameters:
    `uri` - The URI
  Returns:
    The format or null if none

### areFileExtensionsEnabled

    public static boolean areFileExtensionsEnabled()

  Returns the value of the "grails.mime.file.extensions" setting configured in COnfig.groovy

  Returns:
    True if file extensions are enabled

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2005-2006 The Grails project