Multiple select list values
I know I can do this in PHP, it must be possible using JSP but I'm new to it.
I'd like to take the multiple values of a SELECT list in a form and process them. Using PHP I would set the SELECT NAME to be an array and process the array. I tried this in some JSP but it didn't work. I am trying to use request.getParameter("selectname") but the compiler tells me I can only use a string with it.
Someone out there is bound to know the answer.
Unlike PHP, you don't use the square brackets in the name of the field (), just use a normal field name. However, when you go to retrieve the values, use the method request.getParameterValues(String) instead of getParameter(String). request.getParameterValues(String) returns an array of Strings.
Excellent Nemi! Thank you VERY much. I have had all sorts of wild goose chase help on this one from people but your getParameterValues tip is spot on.