问题描述
- ajax contentType:"application/json"
-
ajax发送请求后台要怎么接收 contentType:"application/json"
function add() {$.ajax({ type: "POST", dataType:"json", contentType:"application/json; charset=UTF-8", url: "$appServer.get('sys_center/webservice/login/Login.htm')?random=$!{random}", data: JSON.stringify({"account":"admin","password":"c4ca4238a0b923820dcc509a6f75849b"}), success: function(result) { alert(result) } });
}
@RequestMapping(value={"sys_center/webservice/login/Login"},headers = "Accept=application/json")
@ResponseBody
public void params(@RequestBody SysUser sysUser,HttpServletRequest request) {
System.out.println();
}
}
不知道怎么回事 接收不到诶 求解
解决方案
System.out.printLn() 变量呢
解决方案二:
struts2 ajax提交,令我崩溃的contentType:"application/json"
时间: 2024-09-28 22:23:40