You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ma...@tumbleweed.com on 2001/09/01 21:16:41 UTC

Re: Struts handling of checkbox parameter values

If you make your form bean property a String array, Struts will populate it
from the request for you.

You might also want to take a look at the <html:multibox> tag, which comes
in handy for this type of thing.

--
Martin Cooper


----- Original Message -----
From: "Peter Pilgrim" <pe...@db.com>
To: <st...@jakarta.apache.org>
Sent: Friday, August 31, 2001 5:02 AM
Subject: Struts handling of checkbox parameter values


> How does do perform "String [] HttpServletRequest.getParameterValues()"
> with a Struts Action and Action Form?
>
> If you a html form with a group of html checkbox elements like so
>
> <input type="checkbox" name="fruits" value="apple" > apple
> <input type="checkbox" name="fruits" value="orange" > orange
> <input type="checkbox" name="fruits" value="pear" > pear
>
> You would get an String array with raw Servlet request parameter.
> Which looks like this "orange|apple| pear" assume all item were selected.
>
> Tia
> --
> Peter Pilgrim          |  |        ++44 (0)207-545-9923
>             .... \  \  ___   /  / ... .
>             -   ----  ( * )  ---   --
> _____________________________Cafe_Savannah,_San Antonio,Ibiza__
>
>
>
> --
>
> This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.
>
>