async : true, cache : false, type : 'POST', dataType : "json", url : "person/login",// 请求的action路径 data : { "person.username" : $("#username").val(), "person.password" : $("#password").val() }, error : function() {// 请求失败处理函数 alert('请求失败'); }, success : function(data) { // 请求成功后处理函数。 if (data == null) { $("#login_msg").html("登录成功"); window.location = "index.jsp"; } else if (data.errorMsg != null) {// 后台异常处理 $("#login_msg").html(data.errorMsg); } } });
后台的action可以接收到username和 password;但之后一直返回error,弹出“请求失败”对话框,这是怎么回事呢?