0

I send an array that got two arrays inside, "rows" and "columns" like this.

$.ajax({
           url: 'ServletPost',
           type: 'post',
           data: {rows:rowValues, columns:columnValues},
           dataType: 'json',
           success: function(data){
               // insert your server-calculated data to dom   
               var rows = data.rows,
                columns = data.columns;

                // insert your server-calculated data to dom   
                $("td.total").each(function(rowIndex){
                    $(this).text(rows[rowIndex+1]);
                });

                $("tr.totalCol td").each(function(columnIndex){
                    $(this).text(columns[columnIndex+1]);
                });
           }
       }); 
});

The problem now is that in my Java I have to recieve that data but I dont know how to recieve it, I tryed with that code:

public class ServletPost extends HttpServlet
{
  public void doPost(HttpServletRequest request,HttpServletResponse response)
   throws IOException, ServletException
  {
      PrintWriter out = response.getWriter();
      int result = Integer.valueOf(request.getParameter("rows"),("columns"));
 }
}

Thank You in Advance guys!

Funereal
  • 625
  • 2
  • 11
  • 29

0 Answers0