📄 logoffaction.java
字号:
package app;
import java.io.IOException;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import org.apache.struts.util.MessageResources;
public final class LogoffAction extends Action {
/**
* Logoff the user.
* The event is logged if the debug level is >= Constants.DEBUG.
*
* @param mapping The ActionMapping used to select this instance
* @param actionForm The 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 {
// Extract attributes we will need
HttpSession session = request.getSession();
LogonForm user = (LogonForm)
session.getAttribute(Constants.USER_KEY);
// Remove user login
session.removeAttribute(Constants.USER_KEY);
// Return success
return (mapping.findForward(Constants.SUCCESS));
}
} // end LogoffAction
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -