Retrieving multiple textbox values with same name from JSP in Servlet

后端 未结 2 1329
悲哀的现实
悲哀的现实 2020-12-21 02:40

I am trying to pass values of textbox with same name from JSP to servlet but not able to accomplish this task.

I tried using this in servlet but i only get one text

2条回答
  •  南方客
    南方客 (楼主)
    2020-12-21 03:20

    If you have a form like that:



    Sends if you put one and two in the textboxs

    words=one&words=two
    

    For getting,

    String[] words = request.getParameterValues("words");
    

提交回复
热议问题