ajax - How to send a javascript array to Java servlet -
hello people i'm doing web application orthodox, method ajax using java , javascript.
and asking me if possible set array javascript servlet.
yes possible!
var test = []; $.ajax({ type: 'get', url: 'someurl', datatype: 'json', data: { test: json.stringify(test) }, success: function(data) { }, error: function(data) { alert('fail'); } });
and in servlet:
string json = request.getparameter("test");
Comments
Post a Comment