jsp前端
var array = new Array();
array.push(0);
array.push(1);
array.push(2);
array.push(3);
array.push(4);
function mydo(){
$.post("del.do",{data:array.toString},function(result){
alert(result);
})
}
后端
此处用的是SpringMVC
@RequestMapping(value="/del.do",produces={"text/html;charset=UTF-8"})
@ResponseBody
public int toDel(Long[] data) {
for (Long long1 : data) {
System.out.println(long1);
}
return "sucess";
}
控制台输出的是 0 1 2 3 4