In PHP it is acceptable for forms to have arrays. For example, from
http://php.net/manual/en/faq.html.php#faq.html.arrays the following form could be
submitted:
<form action="" method="post">
<input name="MyArray[]" value=1 />
<input name="MyArray[]" value=2 />
<input name="MyArray[]" value=3 />
<input name="MyArray[]" value=4 />
<input type="Submit" />
</form>
And in PHP the submitted inputs would be available as an array at
$_POST['MyArray']
Out of curiosity, does XWiki have any similar support for form arrays? I tried a simple
example, for which the returned result was a single value ("1"). Does this mean
XWiki ignores multiple request parameters of the same name, or is there another way?
{{groovy}}
def values = request.get('MyArray[]')
println "${values.getClass()}"
println "${values}"
{{/groovy}}
{{html}}
<form action="" method="post">
<input name="MyArray[]" value=1 />
<input name="MyArray[]" value=2 />
<input name="MyArray[]" value=3 />
<input name="MyArray[]" value=4 />
<input type="Submit" />
</form>
{{/html}}