> Hi All,
>
[quoted text clipped - 10 lines]
> Thanks
> Tarun Garg
You cannot pass arrays from a form to a servlet. It has to be Strings,
or Binary data (multipart requests). Instead of creating an array, you
can set multiple values for the parameter, and use
getParameterValues( ) to get all values as an array. This is pretty
common for checkbox groups, like:
<FORM>
<P>Check all the colors you like</P>
<LABEL><INPUT TYPE="checkbox" NAME="favcolor" VALUE="red">Red</LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="favcolor" VALUE="green">Green</
LABEL>
<LABEL><INPUT TYPE="checkbox" NAME="favcolor" VALUE="blue">Blue</
LABEL>
</FORM>
As you can see, the name is same (favcolor) with different values. If
Red and Green are selected, the query string will look something like ?
favcolor=red&favcolor=green.
-cheers,
Manish
Garg - 10 Feb 2007 05:57 GMT
Thanks Manish, for this valuable information.
I will try this and let you about the result.
thanks once again.
Tarun