日期:2014-05-20 浏览次数:20707 次
public String logout() throws Exception { HttpServletResponse response = ServletActionContext.getResponse(); response.setHeader("Cache-Control","no-cache"); response.setDateHeader("Expires", 0); response.setHeader("Buffe","True"); response.setHeader("ExpiresAbsolute","Now() - 1"); HttpSession session = ServletActionContext.getRequest().getSession(); session.removeAttribute("user"); session.removeAttribute("sessionKey"); session.invalidate(); return SUCCESS; }
if ( user == null) { response.setHeader( "Pragma ", "No-cache "); response.setHeader( "Cache-Control ", "no-cache "); response.setDateHeader("Expires",0); System.out.println("没有登录"); response.sendRedirect(request.getContextPath()+"login.jsp");