Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

## org.codehaus.groovy.grails.plugins.web.api
[Groovy] Class ServletRequestApi

    java.lang.Object
      org.codehaus.groovy.grails.plugins.web.api.ServletRequestApi

    class ServletRequestApi
    extends java.lang.Object

Additional methods added to the HttpServletRequest API.

Authors:
  Graeme Rocher

Since:
  2.0

Property Summary
`groovy.lang.Closure` | `xhrRequestIdentifier`

Method Summary
`java.lang.Object` | `each(javax.servlet.http.HttpServletRequest instance, groovy.lang.Closure c)` enables iteration over request attributes with each method request.each { name, value -> }
`java.lang.Object` | `find(javax.servlet.http.HttpServletRequest instance, groovy.lang.Closure c)` enables searching of request attributes with request.find { it.key == 'foo' }
`java.lang.Object` | `findAll(javax.servlet.http.HttpServletRequest instance, groovy.lang.Closure c)` enables searching of for a number of request attributes using request.findAll { it.key.startsWith('foo') }
`java.lang.String` | `getForwardURI(javax.servlet.http.HttpServletRequest instance)` @return retrieve the forwardURI for the request
`boolean` | `isGet(javax.servlet.http.HttpServletRequest instance)` Return true if the request is a get
`boolean` | `isPost(javax.servlet.http.HttpServletRequest instance)` Return true if the request is a post
`boolean` | `isRedirected(javax.servlet.http.HttpServletRequest instance)` Whether the request has been redirected
`boolean` | `isXhr(javax.servlet.http.HttpServletRequest instance)` @return test whether the current request is an XHR request

Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), 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()

Property Detail

### xhrRequestIdentifier

    groovy.lang.Closure xhrRequestIdentifier

Method Detail

### each

    java.lang.Object each(javax.servlet.http.HttpServletRequest instance, groovy.lang.Closure c)

  enables iteration over request attributes with each method request.each { name, value -> }

### find

    java.lang.Object find(javax.servlet.http.HttpServletRequest instance, groovy.lang.Closure c)

  enables searching of request attributes with request.find { it.key == 'foo' }

### findAll

    java.lang.Object findAll(javax.servlet.http.HttpServletRequest instance, groovy.lang.Closure c)

  enables searching of for a number of request attributes using request.findAll { it.key.startsWith('foo') }

### getForwardURI

    java.lang.String getForwardURI(javax.servlet.http.HttpServletRequest instance)

  Returns:
    retrieve the forwardURI for the request

### isGet

    boolean isGet(javax.servlet.http.HttpServletRequest instance)

  Return true if the request is a get

### isPost

    boolean isPost(javax.servlet.http.HttpServletRequest instance)

  Return true if the request is a post

### isRedirected

    boolean isRedirected(javax.servlet.http.HttpServletRequest instance)

  Whether the request has been redirected
  Parameters:
    `instance` - The request instance
  Returns:
    true if the request has been redirect

### isXhr

    boolean isXhr(javax.servlet.http.HttpServletRequest instance)

  Returns:
    test whether the current request is an XHR request

Groovy Documentation