Reputation: 1261
new to ajax and not quite sure whats wrong. I have:
var myArray = [2324.031536 ,
2355.015241 ,
2397.099387 ,
2444.286019];
$(document).ready(function() {
$('#submit').click(function(event) {
$.get('VsPredictionServlet',{myArray:myArray},function(responseText) {
$('#text').text(responseText);
});
});
});
and in servlet:
String[] myArray = request.getParameterValues("myArray");
but myArray is null in servlet.
Any suggestions?
Upvotes: 0
Views: 378
Reputation: 869
just do this:
$.get('VsPredictionServlet',{ "myArray": myArray},function(responseText) {
$('#text').text(responseText);
});
you need to pass parameter as a string.
Upvotes: 1