How to pass an array within a query string?

前端 未结 10 1338
一整个雨季
一整个雨季 2020-11-22 02:35

Is there a standard way of passing an array through a query string?

To be clear, I have a query string with multiple values, one of which would be an array value.

10条回答
  •  一向
    一向 (楼主)
    2020-11-22 02:50

    I feel it would be helpful for someone who is looking for passing the array in a query string to a servlet. I tested below query string and was able to get the array values using req.getgetParameterValues(); method. Below is the query string I passed through browser.

      http://localhost:8080/ServletsTutorials/*.html? 
      myname=abc&initial=xyz&checkbox=a&checkbox=b
    

    checkbox is my parameter array here.

提交回复
热议问题