(一)SpringMVC Ajax使用
$.ajax({
url: "http://localhost:8080/demo/user/login",
type: "POST",
data: "name"="admin",
async: false,
success: function(data) {
alert("success");
},
error: function() {
alert("error");
}
});
Controller
@Controller
@RequestMapping("/user/*")
public class LoginController {
@RequestMapping(value="login")
public @ResponseBody String login(HttpServletRequest request,HttpServletResponse response){
String name =request.getParameter("name")
System.out.println();
return name;
}
(二)返回中文乱码
http://www.cnblogs.com/HDK2016/p/7257177.html