other register

Friday, March 20, 2009

Submit an array as a parameter

When you have an array of values to submit like the code below:

<g:each in="${people}" var="person">

<input type="checkbox" name="emails[]" value="${}" />

When submiting this form, the emails[] will be submitted as an array/list object like [Ljava.lang.String;@151313a. To get the value out of the object, do:


That will get the value like: [,]

No comments: