前台:
var idArray = [];
$("section td input[type='checkbox']:checked").each(function(){
idArray.push($(this).attr("name"));
})
$.ajax({
url : context + "/matches/release",
type : 'post',
data: {'idArray':idArray},
traditional:true,
success:function(data){
}
})
注意: traditional:true 要加,否则http传的参数会变为 Array[]=111&&Array[]=222
后台:
@RequestMapping(value = "/release", method = RequestMethod.POST)
@ResponseBody
public boolean releaseMatches( Integer[] idArray)
throws IOException {
return true;
}