I have a situation on my website where I am utilizing ajax to send information to a java servlet and then using the following javascript code to read the response:
$.ajax({
url : 'myfirstservlet',
async: false,
data : {
//send info..
},
success : function(responseText) {
//receive response..
}
});
In my servlet, I am sending back multiple responses. For example:
String response1 = "response1";
int response2 = 5;
out.println(response1);
out.println(response2);
So how can I retrieve these two different responses and store them in separate javascript variables?
For instance:
$var response1 = ['response1'];
$var response2 = ['response2'];
Thank you :)