request.getParameterValues()

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!!!

1 comment

  1. how to get values from jsp page………

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>