Logout.java
上传用户:wlfwy2004
上传日期:2016-12-12
资源大小:33978k
文件大小:1k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. package com.opensource.blog.web.action;
  2. import org.apache.struts.action.ActionMapping;
  3. import org.apache.struts.action.ActionForm;
  4. import javax.servlet.http.HttpServletRequest;
  5. import javax.servlet.http.HttpServletResponse;
  6. import javax.servlet.http.HttpSession;
  7. import org.apache.struts.action.ActionForward;
  8. import org.apache.struts.action.Action;
  9. import com.opensource.blog.comm.*;
  10. public class Logout
  11.     extends Action {
  12.   public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm,
  13.                                HttpServletRequest servletRequest,
  14.                                HttpServletResponse servletResponse) {
  15.     HttpSession session = servletRequest.getSession();
  16.     session.removeAttribute(Constant.USER_SESSION_KEY);
  17.     return new ActionForward("/login.do", true);
  18.   }
  19. }