views:

57

answers:

3

Hello i have an url in my jsp and i want to pass an array of string in this url to recover in my ActionForm

+1  A: 

You can use 'standard' html way of passing arrays of data: http://mywebsite/mypage?myarray=value1&myarray=value2&myarray=value3. Then you can fetch all values of parameter myarray from request object (if framework doesn't provide more elegant ways of handling arrays).

But seeing your comment, I would recommend to leave JavaScript and just declare a form for it.
If you need a link (not button), you can always submit form from it. Something like <a href="javascript:$('#myForm').submit();">...</a>

Nikita Rybak
I do not know how to do this
Mercer
A: 

If you are dealing with something simple like a list of numeric ids, i would just run through the check boxes, create a comma separated list, and assign it to a query string parameter. On the other side i would split the string. If the values are more complex you have to consider escape characters. Also if you are dealing with a long list, the url is not the best way to pass this data.

Andrey
A: 

Try Json encode

http://code.google.com/p/json-simple/

Check this

zod