request.getParameterValues()
Posted: January 14th, 2008 | Author: Nischal Shetty | Filed under: General | No Comments »request.getParameterValues(String) in java helps retrieve a String array as parameter from the JSP.
i.e. If you have more than one value set for a variable in the JSP with the same name, you can get it as a String array using request.getParameterValues(“parameterName”)
Ex. in my jsp I set the variable as follows:
<input type=”hidden” name=”colour” value =”red”>
<input type=”hidden” name=”colour” value =”blue”>
<input type=”hidden” name=”colour” value =”green”>
Next, I try to obtain these values at the back-end java file as follows:
String colour[] = request.getParameterValues(“colour”);
All the three colours set in the JSP will be obtained in an array!!!












Leave a Reply