js+springMVC如何提交数组数据到后台-创新互联
这篇文章将为大家详细讲解有关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 { ... }
关于“js+springMVC如何提交数组数据到后台”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。
当前文章:js+springMVC如何提交数组数据到后台-创新互联
网页地址:http://ybzwz.com/article/ddpjde.html