logoffaction.java

来自「First of all, the Applet-phone is a SIP 」· Java 代码 · 共 44 行

JAVA
44
字号
/* * LogoffAction.java * * Created on November 14, 2003, 10:40 AM */package gov.nist.struts.webapp.login;import org.apache.log4j.Logger;import javax.servlet.*;import javax.servlet.http.*;import gov.nist.security.authentication.*;/** * Clean the session and other things from the webapp since the user is login off * @author  DERUELLE Jean */public class LogoffAction extends org.apache.struts.action.Action{    /** log4j logging*/    static Logger logger = Logger.getLogger(LogoffAction.class);    /** Creates a new instance of LogoffAction */    public LogoffAction() {    }        /**     * @see org.apache.struts.action.Action#perform(org.apache.struts.action.ActionMapping actionMapping, org.apache.struts.action.ActionForm actionForm, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)     */    public org.apache.struts.action.ActionForward perform(org.apache.struts.action.ActionMapping actionMapping, org.apache.struts.action.ActionForm actionForm, javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse) throws java.io.IOException, javax.servlet.ServletException {        //Get the application context                                     ServletContext applicationContext=this.getServlet().getServletContext();            HttpSession session=httpServletRequest.getSession();        UserTag user=(UserTag)httpServletRequest.getSession().getAttribute("user");                    logger.info("The user "+user.getUserName()+" has logged off");        session.removeAttribute("user");        session.removeAttribute("uploadPath");            session.removeAttribute("monitors");          session.removeAttribute("starting up");          return actionMapping.findForward("logoff");    }    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?