ajax传字符串数字springmvc接收

前端代码:
$.ajax({
url:url,
type:"POST",
data:JSON.stringify(graphOperate.data),// 核心
contentType:'application/json;charset=UTF-8',// 核心
success:function(res){
debugger;
console.log("删除成功!",res);
//status = res.status;
}
});

springmvc代码:
@ResponseBody
@RequestMapping(method = RequestMethod.POST, value = "/batchDelGraphIds")
public Map batchDelGraphIds(@RequestBody String [] graphIds){
Map res = new HashMap();
res.put("graphIds", graphIds);
return res;
}

你可能感兴趣的:(ajax传字符串数字springmvc接收)