0
新增了ajax,但不太清楚最新的错误。我有:通过ajax将数组传递给servlet给出了空参数
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);
});
});
});
和servlet的:
String[] myArray = request.getParameterValues("myArray");
但myArray的是空的servlet的。
有什么建议吗?
不,仍然通过为空 – user1584120
使用未来'JSON.stringify' 数据= JSON.stringify({ “myArray的”= myArray的 }); $('VsPredictionServlet',data,function(responseText){ $('#text')。text(responseText); }); – rsudip90