public
String Login()
throws
Exception{
User u=userdao.findByName(user);
int
LoginTimes=
0
;
Integer o=(Integer)ServletActionContext.getContext().getSession().get(
"LT"
);
if
(o!=
null
){
LoginTimes=o;
}
if
(u.getPassword().equals(user.getPassword())){
return
SUCCESS;
}
else
{
LoginTimes++;
ServletActionContext.getContext().getSession().put(
"LT"
,LoginTimes);
System.out.println(LoginTimes);
if
(LoginTimes==
3
){
ServletActionContext.getContext().getSession().put(
"LoginTimes"
,
"您已经连续三次登录失败,账户已锁"
);
}
return
INPUT;
}
}