Multiple select how to capture all selections in java
I am using a multiple options select in my HTML form, when I select more than one option and use the 'GET' method in my form I s开发者_高级运维ee this
url?Ripples=1.3&Ripples=1.4
As you can see each selection has the same name, when I pass this to my jsp and display the variable I only get this first option which in this case is 1.3. How do I get all the selections into my java strings?
you can use
String[] ripples = request.getParameterValues("Ripples");
Ideally this should be handled by a POST request.
request.getParameterValues("Ripples")
request.getParameterValues(argument)
will return a list of the selected items.
精彩评论