skykkkkkjj 2010-06-09 10:28
浏览 230
已采纳

Extjs登录出错,大家帮忙看看。

我们公司因为项目需要想把界面弄成ExtJs的。我以前也没学过,临时弄了点例子,结果发现问题了,我用的是Struts2 Spring Hibernate Mysql

private boolean success;
private String message;
private String username;
private String password;
private String randCode;
private DefaultService ds;
public String execute() throws Exception{
if(username.equals("username")){
this.success = true;
this.message="你的账号是:"+username+"密码为:"+password;
}else{
this.success=false;
this.message="您输入的用户不能登陆系统";
}

return SUCCESS;
}

public String getMessage() {
    return message;
}

public void setMessage(String message) {
    this.message = message;
}

public String getPassword() {
    return password;
}

public void setPassword(String password) {
    this.password = password;
}

public String getRandCode() {
    return randCode;
}

public void setRandCode(String randCode) {
    this.randCode = randCode;
}

public boolean isSuccess() {
    return success;
}

public void setSuccess(boolean success) {
    this.success = success;
}

public String getUsername() {
    return username;
}

public void setUsername(String username) {
    this.username = username;
}

public DefaultService getDs() {
    return ds;
}

public void setDs(DefaultService ds) {
    this.ds = ds;
}

login : function() {
this.fp.form.submit({
waitMsg : "正在登陆......",
url : "./Login.action",
success : function(form, action) {
window.location.href = "";
},
failure : function(form, action) {
form.reset();
if(action.failureType == "connect"){
Ext.Meg.alert("服务器指定的路径链接不上");
}
if (action.failureType == Ext.form.Action.SERVER_INVALID) {
Ext.MessageBox
.alert("警告", action.result.errors.msg);
}else{
Ext.MessageBox
.alert("登陆失败", action.result.message);
}
}
}
);
}

每次返回的failureType 只要注入了ds就返回 "connect" , 如果不注入就能正常传递。

  • 写回答

2条回答 默认 最新

  • upup1000 2010-06-09 11:24
    关注

    api上写着,这个错误,可以通过response获取更详细的信息

    你可以试着打印一下 action.response.responseText

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?