在这一步,我是在登录失败那里加入this.addFieldError("loginError", "用户名或者密码错误!"); ,然后在登录失败页面跳转回到登录页面提示,“”用户名或者密码错误“”,感觉这个是我们网站一般这么提示的
2017-10-30
测试了N多遍,在queryQuery query = session.createQuery(hql);这里一直是flase,然后在qpl改成hql="from Users where username= 'admin' and password= '123' ";把后面setParemeter,删了变成true了。一直在想这是什么原因找了一天也找不原因
2017-10-29
登录时总是出现500错误,有哪位大神可以帮忙解决一下,Unable to instantiate Action, com.action.UsersAction, defined for 'Users_login' in namespace '/'com.action.UsersAction
String str = request.getParameter("birthday");
Date birthday = (Date) new SimpleDateFormat("yyyy-MM-dd").parse(str);
Date birthday = (Date) new SimpleDateFormat("yyyy-MM-dd").parse(str);
2017-10-09
我显示不出来的原因:折腾了半天发现是 代码写错了 request.setAttribute(),然后后面取得时候用#session,把request.setAttribute()写成session.setAttribute()就好。。
2017-10-09
implements ModelDriven<Students>
private Students student = new Students();
@Override
public Students getModel() {
return student;
}
public String add() {
StudentsDAOImpl dao = new StudentsDAOImpl();
student.setSid(dao.generateSid());
dao.addStudents(student);
return "add_success";
}
private Students student = new Students();
@Override
public Students getModel() {
return student;
}
public String add() {
StudentsDAOImpl dao = new StudentsDAOImpl();
student.setSid(dao.generateSid());
dao.addStudents(student);
return "add_success";
}
2017-10-04