Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_jsp thread: Multiple selects with JSP


Message #1 by "Nathan Johnson" <johnson@e...> on Wed, 27 Sep 2000 15:57:40 +0100
correct. request.getParameter(String) returns only the first element of the
array in cases like this.

Jeroen T. Wenting
jwenting@h...

Murphy was wrong, things that can't go wrong will anyway

> -----Original Message-----
> From: Richard Huss [mailto:richardh@w...]
> Sent: Wednesday, September 27, 2000 17:52
> To: Pro_JavaServer_Pages
> Subject: [pro_jsp] Re: Multiple selects with JSP
>
>
> > Is there a way to parse multiple selects in JSP from the following HTML
> > select input?
> >
> > <select name="select" size="10" multiple>
> > <option>1</option>
> > <option>2</option>
> > <option>3</option>
> > <option>4</option>
> > <option>5</option>
> > <option>6</option>
> > <option>7</option>
> > <option>8</option>
> > <option>9</option>
> > <option>10</option>
> > </select>
> >
> > When I print the following for debuggin purposes, it only
> prints the first
> > selected item:
> > [<%=request.getParameter("select")%>]
>
> I think you need to use request.getParameterValues() rather than
> request.getParameter(); this returns an array of String objects.
>
> Richard Huss
> Technical Editor, Wrox Press Ltd
> richardh@w...
>
> www.wrox.com
> p2p.wrox.com
> www.wroxconferences.com
> www.asptoday.com
>
> ---
> To place your message here, or to sponsor this list, please e-mail
> mailto:p2pinfo@w...?subject=MediaPack, remembering to provide
> contact details for yourself. We will e-mail you a Media Pack
> within 24 hours.


  Return to Index