ajax springmvc 实例,js+springMVC 提交数组数据到后台的实例,spring怎么注入数组

js+springMVC 提交数组数据到后台的实例,spring怎么注入数组

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 提交数组数据到后台的实例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持3672js教程。

本站文章为3672js教程网友分享投稿,版权归原作者,欢迎任何形式的转载,但请务必注明出处。同时文章内容如有侵犯了您的权益,请联系我们处理。