title: how to pass java-script array into JAVA array using AJAX
body: <p>I am trying to post an array of JavaScript into an array of Strings in Java. It goes like this...</p>
  
  <p>My JavaScript code:</p>
  
  <pre><code>var quantity_arr = new Array();
  
  for (var i=0; i&lt; &lt;%= cart.size() %&gt;; i++) {
      quantity_arr[i] = document.getElementsByClassName("quantity")[i].value;
  }
  xmlhttp.send("sum_of_order="+sum_of_order+"&amp;credits_number="+credits_no+"&amp;credit_card_number="+credit_card_number+"&amp;quantity_arr="+quantity_arr);
  </code></pre>
  
  <p>This is my Java code:</p>
  
  <pre><code>String[]  myParams =new String[cart.size()];
  String order_id=Integer.toString(temp);
  String customer_id="'"+session.getAttribute("user_id")+"'";
  String date= "15/29/12";
  String sum=request.getParameter("sum_of_order");
  String credit_card= "'"+request.getParameter("credit_card_number")+"'";
  String credits="'"+request.getParameter("credits_number")+"'";
  myParams = request.getParameterValues("quantity_arr");
  </code></pre>
  
  <p>All the params works fine except the <code>myParams array</code> that gets nothing. Can someone help me with this?</p>