Actually, it depends on the version of the Servlet API. What Corey describes
is the typical, but unspecified, behavior of a servlet container predating
the 2.1 specification (I believe Apache JServ is the only container that still
only supports version 2.0). The behavior Antonio describes is the correct
behavior described in Servlet 2.1 and later.

Hans

"Corey A. Johnson" wrote:
>
> Actually...  with a MULTIPLE select box, you will need to use a
> StringTokenizer, since the parameter value will be a comma separated
> list of all select options...
>
> for (Enumeration p = request.getParameterNames() ; p.hasMoreElements()
> ;) {
>    name = p.nextElement().toString() ;
>    value = req.getParameter(name) ;
>    if(name.equals("NAME")) {
>       st = new StringTokenizer(value, ",");
>       while (st.hasMoreTokens()) {
>          // do something with each token.
>          System.err.println(st.nextToken());
>       }
>    }
> }
>
> Hope that helps!
>
> Cj
>
> Antonio Jimenez wrote:
> >
> > in a multiple select
> >
> >     <select multiple name="NAME" size="5">
> >         <option value="1">value 1</option>
> >         ...
> >     </select>
> >
> > you can use
> >
> >         for (Enumeration p = request.getParameterNames() ; p.hasMoreElements() ;) {
> >             name = p.nextElement().toString() ;
> >             value = req.getParameter(name) ;
> >             ...
> >         }
> >
> > "Anna Sp�ngberg" wrote:
> > >
> > > How do i get
> > >
> > > multiple values from a select menu with request.getParameter ?
> > >
> > > thanks
> > >
> > > anna

--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to