Passing data in ajax can use
var checkedIds = new Array(); checkedIds.push(1); checkedIds.push(2); checkedIds.push(3); $.ajax({ url:"bookBatchdelete.do", data:{ checkedIds : checkedIds }, type:"post", dataType:"json", traditional: true, success:function(data){ } })
Background receive can use:
@RequestMapping(value="xxx.do") @ResponseBody public String bookBatchDelete(HttpServletRequest request, String[] checkedIds){ }
Note: The key is to set $.ajax({traditional: true,}), otherwise the background String[] checkedIds will not receive the value