Web Tools (3) Questions about request.getParameterValues("")

  1. In request.getParameterValues(“”), what in the “” is its name, not the id, and name can be the same, and then it will get a String Array.

  2. If there is a list of checkbox in HTML should be submitted to the Servlet, and all of them have the same name, we should get the checkboxes’s value.
    When we submit, the Browser will put the values of the checkboxes into a String Array. In Servlet, we can use that
    String[] chk = request.getParameterValues(“checkbox’s name);
    and then can get all the values of checkboxes we choose. But if we don’t choose that checkbox, the chk will be null.

Contents
|