springmvc以list形式接收数组

来源:互联网 发布:超星电子图书馆数据库 编辑:程序博客网 时间:2024/06/02 03:19

前端代码:

var a = [ 1, 2, 3, 4, 5, 6, 7 ];$.ajax({url : "/Udian/alipayAppPay/withdraw_cash_audit",type : "post",dataType : "json",data : {billIds : a},success : function(data) {console.log(1);}});

后台代码:

@RequestMapping(value = "/withdraw_cash_audit", method = RequestMethod.POST)public void withdrawCash(@RequestParam("billIds[]") List<Integer> billIds) {for (Integer integer : billIds) {System.out.println(integer);}}

输出:


原创粉丝点击