首页上一页 1 下一页尾页 1 条记录 1/1页
jsp项目开发实录 第三章 电子商务网站2
发表在JavaWeb图书答疑
2010-05-18
是否精华
是
否
版块置顶:
是
否
我觉得是// 会员登录
public ActionForward checkMember(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String name = request.getParameter("name");
MemberForm memberForm = dao.selectMemberForm(name);
if (memberForm==null||memberForm.equals("")) {
request.setAttribute("result", "不存在此会员,请重新登录!!!");
} else if (!memberForm.getPassword().equals(request.getParameter("password").trim())) {
request.setAttribute("result", "密码错误,请重新登录!!!");
} else {
request.setAttribute("memberForm", memberForm);
}
return mapping.findForward("checkMember");
}这段代码的写法,我试验了,如何我是在数据库上直接输入数据就可以登录,但是如果要是在前台的注册页注册后,就算用户名和密码正确也会提示密码错误
public ActionForward checkMember(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
String name = request.getParameter("name");
MemberForm memberForm = dao.selectMemberForm(name);
if (memberForm==null||memberForm.equals("")) {
request.setAttribute("result", "不存在此会员,请重新登录!!!");
} else if (!memberForm.getPassword().equals(request.getParameter("password").trim())) {
request.setAttribute("result", "密码错误,请重新登录!!!");
} else {
request.setAttribute("memberForm", memberForm);
}
return mapping.findForward("checkMember");
}这段代码的写法,我试验了,如何我是在数据库上直接输入数据就可以登录,但是如果要是在前台的注册页注册后,就算用户名和密码正确也会提示密码错误