web开发中遇到的小问题

(1)退出登陆:

private void LoginOut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException  {
      HttpSession session = request.getSession(false);//防止创建Session
      if(session == null){
       path = "WEB-INF/user/admin_login.jsp";
      return;
      }
      session.removeAttribute("username");
      path = "index.jsp";    
      }

posted @ 2016-01-07 12:22  行行在路上  阅读(138)  评论(0编辑  收藏  举报