title: get and send data in String[] Array using servlet
body: <pre><code> int i = 0;
   String[] pnumbers = new String[3];
   String[] pqtys = new String[3];
  
   protected void doPost(HttpServletRequest request, HttpServletResponse response)
                  throws ServletException, IOException {
  
   String pnumber = request.getParameter("pnumber");
   DAO dao = new DAO();
   Product p = dao.checkProduct(pnumber);
   String qunty = request.getParameter("pqty");
  
    while (i &lt; 3) {
    pnumbers[i] = p.getNumber();
    pqtys[i] = p.getQty();
    i++;
    }
  request.setAttribute("pnum" pnumbers);
  }
  </code></pre>
  
  <p>I need to add 3 items coming by webpage in to this array. but ones you can add one item </p>
  
  <pre><code>&lt;td&gt;
  &lt;input type="text" name="pnumber" value="" /&gt;
  &lt;/td&gt;
  &lt;td&gt;
  &lt;input type="text" name="pqty" value="" /&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>i need to add only 3 items to array after adding those 3 i need to get that values again to same page please help? </p>