## grails.util
Class GrailsWebUtil

    java.lang.Object
      grails.util.GrailsWebUtil

    public class GrailsWebUtil

extends Object

Utility methods for clients using the web framework

Since:
  0.4

  Created: Jan 19, 2007 Time: 6:18:22 PM
Author:
  Graeme Rocher

Field Summary
`static String` `DEFAULT_ENCODING`

Constructor Summary
`GrailsWebUtil()`

Method Summary
`static GrailsWebRequest` `bindMockWebRequest()`
`static GrailsWebRequest` `bindMockWebRequest(GrailsWebApplicationContext ctx)`
`static String` `getContentType(String name, String encoding)`
`static groovy.lang.GroovyObject` `getControllerFromRequest(HttpServletRequest request)`
`static GrailsScaffolder` `getScaffolderForController(String controllerName, GrailsWebRequest webRequest)`
`static String` `getUriFromRequest(HttpServletRequest request)` Retrieves the URI from the request from either the include attribute or the request.getRequestURI() method

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_ENCODING

    public static final String DEFAULT_ENCODING

See Also:
  Constant Field Values

Constructor Detail

### GrailsWebUtil

    public GrailsWebUtil()

Method Detail

### bindMockWebRequest

    public static GrailsWebRequest bindMockWebRequest(GrailsWebApplicationContext ctx)

### bindMockWebRequest

    public static GrailsWebRequest bindMockWebRequest()

### getUriFromRequest

    public static String getUriFromRequest(HttpServletRequest request)

  Retrieves the URI from the request from either the include attribute or the request.getRequestURI() method

  Parameters:
    `request` - The HttpServletRequest instance
  Returns:
    The String URI

### getControllerFromRequest

    public static groovy.lang.GroovyObject getControllerFromRequest(HttpServletRequest request)

### getContentType

    public static String getContentType(String name,
                                        String encoding)

### getScaffolderForController

    public static GrailsScaffolder getScaffolderForController(String controllerName,
                                                              GrailsWebRequest webRequest)

Copyright (c) 2005-2006 The Grails project