public org.apache.struts.action.ActionForward | execute(org.apache.struts.action.ActionMapping mapping, org.apache.struts.action.ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Process the specified HTTP request, and create the corresponding HTTP
response (or forward to another web component that will create it).
Return an ActionForward instance describing where and how
control should be forwarded, or null if the response has
already been completed.
// --------------------------------------------------------- Public Methods
// Extract attributes we will need
Locale locale = getLocale(request);
MessageResources messages = getResources(request);
HttpSession session = request.getSession();
User user = (User) session.getAttribute(Constants.USER_KEY);
// Process this user logoff
if (user != null) {
if (log.isDebugEnabled()) {
log.debug("LogoffAction: User '" + user.getUsername() +
"' logged off in session " + session.getId());
}
} else {
if (log.isDebugEnabled()) {
log.debug("LogoffActon: User logged off in session " +
session.getId());
}
}
session.removeAttribute(Constants.SUBSCRIPTION_KEY);
session.removeAttribute(Constants.USER_KEY);
session.invalidate();
// Forward control to the specified success URI
return (mapping.findForward("success"));
|