前端:
var arr = new Array();
$(".del").each(function () {
var status = $(this).is(":checked");
if(status){
arr.push($(this).val());
}
})
var json = $.makeArray(arr);
$.ajax({
type: "POST",
url: "delCheckedLogs",
data:JSON.stringify(json),
dataType: "json",
contentType: 'application/json',//这个必须是这个格式
traditional:true,
success: function(data){
console.log((data))
}
});
后端:
@RequestMapping(value = "/delCheckedLogs",method = RequestMethod.POST)
@ResponseBody
public String delCheckedLogs(@RequestBody List<String> arr){
System.out.println(arr);
return "success";
}