67,513
社区成员
发帖
与我相关
我的任务
分享
private String id;
private String pwd;
private String confirmPwd;
private String name;
private int sex;
private int question_id;
private String question;
private String answer;
private String email;
private String registrationDate;
private String securityCode;
private String inputSecurityCode;
然后是各种set和get方法
public String login() //我在struct.xml中配置了method,所以这里就不用execute()了
{
User user = null;
UserEbo userEbo = new UserEbo();
userEbo.setUserDao(new UserDAOImpl());
user = userEbo.login(id, pwd); //这里可以完美执行,id,pwd正确的话,可以成功获得user对象
ActionContext ctxt = ActionContext.getContext();
if(inputSecurityCode == securityCode) //重点在这,一直执行到这一步然后就不行了,问题是再调试过程中,这两个的值是一样的啊,天地良心,有图有真相,请看下面截图
{
if(user != null)
{
ctxt.put("user", user);
ctxt.put("label", "登录成功!自动跳转到主页并自动自动登录");
ctxt.put("hyperLink", "../index.jsp");
return "success";
}
else
{
return "fail";
}
}
else
{
return "fail"; //直接跳到这里,并结束
}
}
五月 11, 2013 9:38:51 上午 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
WARNING: Parameter [id] is not on the excludeParams list of patterns and will be appended to action!
五月 11, 2013 9:38:51 上午 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
WARNING: Parameter [inputSecurityCode] is not on the excludeParams list of patterns and will be appended to action!
五月 11, 2013 9:38:51 上午 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
WARNING: Parameter [pwd] is not on the excludeParams list of patterns and will be appended to action!
五月 11, 2013 9:38:51 上午 com.opensymphony.xwork2.util.logging.jdk.JdkLogger warn
WARNING: Parameter [securityCode] is not on the excludeParams list of patterns and will be appended to action!
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="true" />
<package name="default" namespace="/" extends="struts-default">
<action name = "login" class = "user.action.UserAction" method = "login">
<result name = "success">../ok.jsp</result>
<result name = "fail">login.jsp</result>
</action>
<action name = "register" class = "user.action.UserAction" method = "register">
<result name = "success">../ok.jsp</result>
<result name = "fail">register.jsp</result>
</action>
</package>
</struts>