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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -