You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by "Carole E. Mah" <Ca...@brown.edu> on 2003/06/11 18:24:21 UTC

accessing multiple select params

Normally one can access a reqest parameter like this: ${param.foo}

But what should be done with the result of a multiple select? e.g.

<select name="foo" size="4" multiple>
<option value="farble">Farble warble</option>
<option value="blort">much blortiness</option>
<option value="bar">bar bar bar</option>
<option value="google">google</option>
[etc]
</select>

If I just ask for $(param.foo} in this case, all I get is the first one 
the user selected. So if the user selected 'blort' and 'bar', I only get 
'blort'.

If the 'foo' parameter is getting passed as an array in this case, how 
does EL treat that array, does it give you a param.???? syntax for 
accessing the array, or must the programmer parse it out by hand?

thanks,
-c
------------------
Carole E. Mah
   Carole_Mah@brown.edu
Senior Programmer/Analyst
   Brown University Computing & Information Services
   Academic Technology Services
   Scholarly Technology Group
phn 401-863-2669
fax 401-863-9313
http://www.stg.brown.edu/



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: accessing multiple select params

Posted by "Carole E. Mah" <Ca...@brown.edu>.
Jim,

Thanks very much, that works just fine, e.g.:

<c:forEach items="${paramValues.foo}" var="currentValue">
   <c:out value="${currentValue}" />&nbsp;
</c:forEach>

-c

Jim Kennedy wrote:

> I believe you would use ${paramValues.foo}.  Although I have not tested
> myself yet.  It will return a String[].
> 
> 
> Jim Kennedy
> IT Consultant
> Mobile Phone: 813-503-1484
> -----------------------------------------------------
> 
> 
> ----- Original Message -----
> From: "Carole E. Mah" <Ca...@brown.edu>
> To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
> Sent: Wednesday, June 11, 2003 12:24 PM
> Subject: accessing multiple select params
> 
> 
> 
>>Normally one can access a reqest parameter like this: ${param.foo}
>>
>>But what should be done with the result of a multiple select? e.g.
>>
>><select name="foo" size="4" multiple>
>><option value="farble">Farble warble</option>
>><option value="blort">much blortiness</option>
>><option value="bar">bar bar bar</option>
>><option value="google">google</option>
>>[etc]
>></select>
>>
>>If I just ask for $(param.foo} in this case, all I get is the first one
>>the user selected. So if the user selected 'blort' and 'bar', I only get
>>'blort'.
>>
>>If the 'foo' parameter is getting passed as an array in this case, how
>>does EL treat that array, does it give you a param.???? syntax for
>>accessing the array, or must the programmer parse it out by hand?
>>
>>thanks,
>>-c
>>------------------
>>Carole E. Mah
>>   Carole_Mah@brown.edu



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: accessing multiple select params

Posted by Jim Kennedy <ji...@gigaheads.com>.
I believe you would use ${paramValues.foo}.  Although I have not tested
myself yet.  It will return a String[].


Jim Kennedy
IT Consultant
Mobile Phone: 813-503-1484
-----------------------------------------------------


----- Original Message -----
From: "Carole E. Mah" <Ca...@brown.edu>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Sent: Wednesday, June 11, 2003 12:24 PM
Subject: accessing multiple select params


> Normally one can access a reqest parameter like this: ${param.foo}
>
> But what should be done with the result of a multiple select? e.g.
>
> <select name="foo" size="4" multiple>
> <option value="farble">Farble warble</option>
> <option value="blort">much blortiness</option>
> <option value="bar">bar bar bar</option>
> <option value="google">google</option>
> [etc]
> </select>
>
> If I just ask for $(param.foo} in this case, all I get is the first one
> the user selected. So if the user selected 'blort' and 'bar', I only get
> 'blort'.
>
> If the 'foo' parameter is getting passed as an array in this case, how
> does EL treat that array, does it give you a param.???? syntax for
> accessing the array, or must the programmer parse it out by hand?
>
> thanks,
> -c
> ------------------
> Carole E. Mah
>    Carole_Mah@brown.edu
> Senior Programmer/Analyst
>    Brown University Computing & Information Services
>    Academic Technology Services
>    Scholarly Technology Group
> phn 401-863-2669
> fax 401-863-9313
> http://www.stg.brown.edu/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org