springmvc与ajax
functionlogin(){varemail=$("#email").val();varpassword=$("#password").val();varerrorT...
function login(){
var email = $("#email").val();
var password =$("#password").val();
var errorTip = $("#errorTip").val();
$.ajax({
type: "POST",
url: "/SpringMVC/user/test",
// contentType : "application/json",
// dataType : "json",
date:{"email":"root","password":"111"},
success: function() {
}
});
};
java:
@RequestMapping(value="/test")
public void assign(String email,String password) {
System.out.println("email:" + email);
System.out.println("password:" +password);
}
为什么结果是
email:null
password:null
怎么接收啊 展开
var email = $("#email").val();
var password =$("#password").val();
var errorTip = $("#errorTip").val();
$.ajax({
type: "POST",
url: "/SpringMVC/user/test",
// contentType : "application/json",
// dataType : "json",
date:{"email":"root","password":"111"},
success: function() {
}
});
};
java:
@RequestMapping(value="/test")
public void assign(String email,String password) {
System.out.println("email:" + email);
System.out.println("password:" +password);
}
为什么结果是
email:null
password:null
怎么接收啊 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询