I see that if an entry form in html has an input type = text ... I can read this text as a String with
request.getParameter( fieldname ).
But how can I read a List if the select is multiple?
I would like to set an ArrayList in a bean based on more than one parameter. Like this
List<String> values = request.getParameter( fieldsList );
I think you are looking for getParameterValues:
getParameterValues
String[]getParameterValues(Stringname) Returns anarrayof String objects containing all of the values the given request parameter has, or null if the parameter does not exist. If the parameter has a single value, the array has a length of 1.Parameters: name - a
Stringcontaining the name of the parameter whose value is requested Returns: an array of String objects containing the parameter's values See Also: getParameter(java.lang.String)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With