logoutaction.java

来自「基于JavaMail开发的E-mail系统」· Java 代码 · 共 35 行

JAVA
35
字号
package ezmail;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class LogoutAction implements Action {

	public LogoutAction() {
	}

	/**
	 *  Performs the following steps...
	 *  <ol>
	 *		<li>....</li>
	 *  </ol>
	 */
	public void perform(ServletContext servletContext,
						HttpServletRequest request,
						HttpServletResponse response) throws ActionException {

		try {
			HttpSession theHttpSession = request.getSession();

			// invalidate the session
			theHttpSession.invalidate();
		}
		catch (Exception exc) {
			exc.printStackTrace();
			throw new ActionException(exc.getMessage());
		}
	}

}

⌨️ 快捷键说明

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