5、退出

 

**功能三:用户退出功能**
    
    1. 把用户信息从HttpSession中清除

 

/crm/WebContent/top.jsp

5、退出

/crm/src/com/louis/web/action/UserAction.java

    
    /**
     * 登录功能
     * @return
     */
    public String login(){
        User existUser = userService.login(user);
        // 判断,登录名或者密码错误了
        if(existUser == null){
            return LOGIN;
        }else{
            ServletActionContext.getRequest().getSession().setAttribute("existUser", existUser);
            // 登录成功
            return "loginOK";
        }
    }

5、退出

/crm/WebContent/top.jsp

5、退出

/crm/src/com/louis/web/action/UserAction.java

/**
     * 退出功能
     * @return
     */
    public String exit(){
        ServletActionContext.getRequest().getSession().removeAttribute("existUser");
        return LOGIN;
    }

 

posted on 2017-10-21 20:30 Michael2397 阅读(...) 评论(...) 编辑 收藏

相关文章:

  • 2022-02-26
  • 2022-01-07
  • 2022-02-07
  • 2022-12-23
  • 2021-09-26
  • 2022-12-23
  • 2022-01-08
猜你喜欢
  • 2021-09-09
  • 2021-07-10
  • 2021-06-13
  • 2021-10-09
  • 2021-05-18
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案