view/controller params

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

view/controller params

Jonathan Carlson
I noticed the params Map in the generated controller, however I don't
see anything about it in the View or  Controller User Guide pages.  If
someone OKs this, I'd be happy to add some documentation about it.

Accessible variables in both the view and the controller:

params ( a Map, so access like this: params['id'] )
request ( see javax.servlet.http.HttpServletRequest )
session ( a Map, so access like this: session['messageId'] )



What other variables are available that I missed?


Thanks!

- Jonathan

______________________________________________________________________
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

Katun Corporation -- www.katun.com
_____________________________________________________________________
Reply | Threaded
Open this post in threaded view
|

Re: view/controller params

graemer
On 3/27/06, Jonathan Carlson <[hidden email]> wrote:
> I noticed the params Map in the generated controller, however I don't
> see anything about it in the View or  Controller User Guide pages.  If
> someone OKs this, I'd be happy to add some documentation about it.
>
> Accessible variables in both the view and the controller:
>
> params ( a Map, so access like this: params['id'] )
> request ( see javax.servlet.http.HttpServletRequest )
> session ( a Map, so access like this: session['messageId'] )

Hi Jonathan,

The full list of dynamic properties/methods can be viewed here with
example usages: http://grails.codehaus.org/Dynamic+Methods+Reference

params accesses requeste and controller parameters
request accesses request attributes
session accesses session attributes

You can also access them with the slightly neater syntax like:

params.id

Cheers
Graeme

>
>
>
> What other variables are available that I missed?
>
>
> Thanks!
>
> - Jonathan
>
> ______________________________________________________________________
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
>
> Katun Corporation -- www.katun.com
> _____________________________________________________________________
>