Struts login
List list=dao.getLogin(loform.getUsername(),loform.getPassword());
if(list.size()<1){
log.info("失败");
errors.add("errors.1",new ActionError("errors.login"));
saveErrors(request,errors);
return mapping.findForward("errors");
}else if((Muser)session.getAttribute("user")!=null&&false){//暂时不开通,等有了注销后再开通
log.info("失败:已经登录");
errors.add("errors.1",new ActionError("errors.login"));
saveErrors(request,errors);
return mapping.findForward("errors");
}else{
session.setAttribute("user",(Muser)list.get(0));
log.info("登录成功");
errors.add("success.1",new ActionError("success.login"));
saveErrors(request,errors);
return mapping.findForward("success");
}
}
if(list.size()<1){
log.info("失败");
errors.add("errors.1",new ActionError("errors.login"));
saveErrors(request,errors);
return mapping.findForward("errors");
}else if((Muser)session.getAttribute("user")!=null&&false){//暂时不开通,等有了注销后再开通
log.info("失败:已经登录");
errors.add("errors.1",new ActionError("errors.login"));
saveErrors(request,errors);
return mapping.findForward("errors");
}else{
session.setAttribute("user",(Muser)list.get(0));
log.info("登录成功");
errors.add("success.1",new ActionError("success.login"));
saveErrors(request,errors);
return mapping.findForward("success");
}
}