Description

The standard Servlet API provides access to parameters with the HttpServletRequest object. Although Grails provides the same capability through the request object, it goes a bit further by providing a mutable map of request parameters called params.

The params object can be indexed into using the array index operator or de-reference operator, so given the URL /hello?foo=bar you can access foo with

println params.foo

The params object can also be used to bind request parameters onto the properties of a domain class using either the constructor or the properties property:

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
Sponsored by SpringSource