[spring annotation] #spring
function icheckDelete(url){
var parms = {
list : array //这是个数组
};
$.ajax({
dataType: "JSON",
contentType:'application/json;charset=UTF-8',//关键是要加上这行
traditional:true,//这使json格式的字符不会被转码
data: JSON.stringify(parms),
type: "DELETE",
timeout: 20000,
url: url,
success : function () {
alert("删除成功!");
},
error : function (data){
alert(data.responseText);
}
});
}
Controller:
@RequestMapping(value = "deleteList", method = RequestMethod.DELETE)
@ResponseBody
public String delete(@RequestBody DeleteListRequest request) throws WebTransException{
/* 逻辑代码 */
return "success";
}