smhy8187

 

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");
   
  }
 }

posted on 2007-08-17 15:46  new2008  阅读(200)  评论(0编辑  收藏  举报

导航