您的位置:首页 > 编程语言 > Java开发

springmvc 传递和接收数组参数

2017-09-02 16:11 459 查看
$.ajax({
type: 'POST',
url: '/demo/informationDelete.do',
data: {
ids:[1,2,3]
},
dataType: 'json',
success: function (data) {
console.log(data);
}
});


/**
* 信息删除
*/
@RequestMapping(value = "informationDelete", method = RequestMethod.POST)
@ResponseBody
public void informationDelete(@RequestParam(value = "ids[]") Integer[] ids) {
for (Integer i:ids) {
System.out.println(i);
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: