LogoutActionpublic class LogoutAction extends Action This class performs the log out from the Project Billboard
application. |
Methods Summary |
---|
public ActionForward | perform(ActionMapping mapping, ActionForm form, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Invalidates the session, thereby removing the authentication
token, and redirects to the login page.
/**
* 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;
|
|