⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminlogoutaction.java

📁 基于struct结构的jsp
💻 JAVA
字号:
package com.ntsky.bbs.action;


import org.apache.struts.action.*;
import javax.servlet.http.*;
import org.apache.log4j.Logger ;

import com.ntsky.bbs.action.Constant;
/**
 * <p>Title: Ntsky OpenSource BBS</p>
 * <p>Description: 管理员session清空</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: WWW.FM880.COM</p>
 * @author 姚君林
 * @version 1.0
 */

public class AdminLogoutAction extends Action {
    private final static Logger logger = Logger.getLogger(AdminLogoutAction.class);
    public ActionForward execute(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws Exception{

        /**@todo: complete the business logic here, this is just a skeleton.*/

        HttpSession session = httpServletRequest.getSession();

        //清除session
        session.removeAttribute(Constant.ADMIN_KEY);
        session.invalidate();
        logger.info("成功删除session");
        return actionMapping.findForward("success");
        //throw new java.lang.UnsupportedOperationException("Method perform() not yet implemented.");
    }
}

⌨️ 快捷键说明

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