日期:2014-05-20 浏览次数:20887 次
HttpServletRequest httpRequest = (HttpServletRequest) request; httpRequest.getSession().setAttribute("login", account); chain.doFilter(httpRequest, httpResponse);
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String userAccount = request.getParameter("userAccount"); respons.setContentType("text/html; charset=UTF-8"); try { out = respons.getWriter(); } catch (IOException e) { e.printStackTrace(); } //注销session HttpSession session = request.getSession(); }
HttpServletRequest httpRequest = (HttpServletRequest)request; Object login = httpRequest.getSession().getAttribute("login");