js+springMVC 提交数组数据到后台

1.ajax 代码

var ids =new Array();
$.ajax({
type: "POST",
url: "/user/downReport",
dataType: "html",
traditional: true,
data:{
downReportArray:ids
},
async: true,
success: function (data) {
if(data.code==200){
console.log("正在打包...")
}
}
});

2.后台接收

    @RequestMapping(value = "/downReport", method = {RequestMethod.POST})
@ResponseBody
public Object downReport(@RequestParam(value = "downReportArray") Long[] downReportArray,HttpServletRequest request ) throws Exception {
  ...
}
上一篇:android 几个小技巧


下一篇:PhpStorm 集成 开源中国(oschina.net)的Git项目,提交SVN时注意事项