What you are seeing is simply the way forms are handled upon submission.
Since all Options have the same name (that in the Select tag) or you've
named your checkboxes the same, they all get assigned to the same
Parameter (request.getParameter("foo")).
It looks like <jsp:setProperty name="foo" property="*" /> is using
request.getParameter("foo"). To get their individual values you'd have to
use request.getParameterValues("foo") which returns a String array.
Perhaps this is a problem with the implementation of <jsp:setProperty ...
> ?
Lance Lavandowska
Software Engineer
http://www.AgDomain.Com
-----Original Message-----
From: Richard Dallaway <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, June 28, 1999 3:07 AM
Subject: Re: Q: set bean param from -OPTION- list
>My example would have been better if I had the syntax right.
>
>Let me try again.
>
>With a HTML <SELECT> list (or set of checkboxes), what is the easiest way
to
>collect the <OPTION> values with a <jsp:useBean>?
>
>For example:
>
><FORM ACTION="/test.jsp" METHOD="POST">
><SELECT MULTIPLE NAME="foo">
><OPTION VALUE="1">One
><OPTION VALUE="2">Two
><OPTION VALUE="3">Three
></SELECT>
>
>...or...
>
><FORM ACTION="/test.jsp" METHOD="POST">
><INPUT TYPE=CHECKBOX NAME=foo value="1"> One <BR>
><INPUT TYPE=CHECKBOX NAME=foo value="2"> Two <BR>
><INPUT TYPE=CHECKBOX NAME=foo value="3"> Three <BR>
>
>
>....I select all three options and submit to a JSP which has the
>following:
>
>--------
><jsp:useBean id="foo" class="com.FooBean" />
><jsp:setProperty name="foo" property="*" />
>
>The value of foo is: <%= foo.getFoo() %>.
>---------
>
>If my foo Bean has a method...
>
>public void setFoo(String value);
>
>.... it will receive the string "1,2,3".
>
>That's sort of OK, but it's a bit dull having to parse out the
>values >(and what if my <OPTION>s have commas in the values?)
>
>So...Is there some easier way to collect <OPTION> values with a bean?
>
>Thanks
>Richard
>
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>
>=========================================================================
==
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
>of the message "signoff JSP-INTEREST". For general help, send email to
>[EMAIL PROTECTED] and include in the body of the message "help".
>
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".