The difference between request.getparameter () and Request.getparametervalues ()

Source: Internet
Author: User

Let's see what the API says.

Java.lang.String getparameter (String name): Returns The value of a request parameter as astring, or null if the parameter does not exist.

Returns the value of a string request parameter that returns NULL if the request parameter does not exist

Java.lang.string[] Getparametervalus (String name): Returns An array of String objects containing all of the values the GIV En request parameter has, ornull if the parameter does not exist.

Returns an array of type string containing all the values of the request parameter, or NULL if the request parameter does not exist


So in a checkbox or a select space, the value of the request parameter may be many, and you can use the Getparametervalus (String name) method to get an array of all the values. The array is then traversed to obtain each parameter.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.