If data1 and data2 are javascript arrays
e.g ["aa","bb"] and ["xx","yy"]
$.ajax({
url : 'testServlet',
type: 'post',
data :
[{"array1" : data1},
{"array2" : data2}]
,
success : function(responseText) {
//...
}
});
how can I retrieve it from the testServlet??
or does my data have to be in the form of json format?(not familiar with this part)
I have tried using
String[] data= request.getParameterValues("array1");
but it is null