protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getSession().invalidate(); // 销毁会话 request.setAttribute("msg", "您已退出"); request.getRequestDispatcher("login.jsp").forward(request, response); }