前台请求参数代码:
var data={"id":"1","name":"2"};
$.ajax({
url: "${pageContext.request.contextPath}/business/chgSort.do",
data:data,
dataType:"json",
type: "post",
contentType:"application/json;charset=utf-8",
后台接收代码:
@RequestMapping(value = "/chgSort",method=RequestMethod.Post)
public void chgSort(@RequestBody User user,HttpServletResponse response) throws Exception{
省略
}
其中id和name是User的属性。求大神搭救啊
var data={"id":"1","name":"2"};
$.ajax({
url: "${pageContext.request.contextPath}/business/chgSort.do",
data:data,
dataType:"json",
type: "post",
contentType:"application/json;charset=utf-8",
后台接收代码:
@RequestMapping(value = "/chgSort",method=RequestMethod.Post)
public void chgSort(@RequestBody User user,HttpServletResponse response) throws Exception{
省略
}
其中id和name是User的属性。求大神搭救啊
----------------------------------------------------------------------