?? logoutaction.java
字號:
package com.ora.jsp.servlets;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.struts.action.*;
/**
* This class performs the log out from the Project Billboard
* application.
*
* @author Hans Bergsten, Gefion software <hans@gefionsoftware.com>
* @version 1.0
*/
public class LogoutAction extends Action {
/**
* Invalidates the session, thereby removing the authentication
* token, and redirects to the login page.
*
* @param mapping The ActionMapping used to select this instance
* @param actionForm The optional ActionForm bean for this request (if any)
* @param request The HTTP request we are processing
* @param response The HTTP response we are creating
*
* @exception IOException if an input/output error occurs
* @exception ServletException if a servlet exception occurs
*/
public ActionForward perform(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) throws IOException, ServletException {
/**
* Invalidate the session, if any. Use false to avoid creating
* a new one if it has already timed out.
*/
HttpSession session = request.getSession(false);
if (session != null) {
session.invalidate();
}
ActionForward nextPage = mapping.findForward("login");
return nextPage;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -