📄 logoutaction.java
字号:
/* * Copyright (C) butor.com. All rights reserved. * * This software is published under the terms of the GNU Library General * Public License (GNU LGPL), a copy of which has been included with this * distribution in the LICENSE.txt file. */package org.butor.web.action;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.servlet.http.HttpSession;import org.apache.struts.action.ActionForward;import org.apache.struts.action.ActionMapping;import org.apache.struts.action.RedirectingActionForward;import org.butor.config.Config;import org.butor.log.Log;import org.butor.web.context.IWebContext;public class LogoutAction extends ButorAction { protected ActionForward executeAction(ActionMapping mapping, IButorActionForm form) throws Exception { IWebContext context = (IWebContext)getContext(); HttpServletRequest request = context.getRequest(); HttpServletResponse response = context.getResponse(); // Reset cookie with the appropriate Locale //resetLocale(request, response); HttpSession session = (HttpSession)request.getSession(false); session.invalidate(); // if no logout url is defined in config, take / (web-app root) by default String logoutUrl = Config.getProperty(PROPERTY_LOGOUT_URL, request.getContextPath() + "/"); Log.logStr(this, Log.LOG_TYPE_INFO, "executeAction", "Redirecting to : " + logoutUrl); return new RedirectingActionForward(logoutUrl); } /** * */ protected boolean hasAccessToApplication() { return true; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -