01 package com.bea.medrec.actions;
02
03 import com.bea.medrec.utils.MedRecLog4jFactory;
04 import com.bea.medrec.utils.MedRecWebAppUtils;
05 import javax.servlet.http.HttpServletRequest;
06 import javax.servlet.http.HttpServletResponse;
07 import org.apache.log4j.Logger;
08 import org.apache.struts.action.ActionForm;
09 import org.apache.struts.action.ActionForward;
10 import org.apache.struts.action.ActionMapping;
11 import weblogic.servlet.security.ServletAuthentication;
12
13 /**
14 * <p>Login controller. Handles all request during the login
15 * process.</p>
16 *
17 * @author Copyright (c) 2006 by BEA Systems. All Rights Reserved.
18 */
19 public class PhysLogoutAction extends PhysBaseAction {
20
21 private static Logger logger =
22 MedRecLog4jFactory.getLogger(PhysLogoutAction.class.getName());
23
24 /**
25 * <p>Process the specified HTTP request, and create the corresponding HTTP
26 * response (or forward to another web component that will create it).
27 * Return an <code>ActionForward</code> instance describing where and how
28 * control should be forwarded.
29 * <br>
30 * Invalidates session and redirects to MedRec homepage.
31 * </p>
32 *
33 * @param mapping The ActionMapping used to select this instance
34 * @param form The optional ActionForm bean for this request (if any)
35 * @param request The HTTP request we are processing
36 * @param response The HTTP response we are creating
37 */
38 public ActionForward executeAction(ActionMapping mapping,
39 ActionForm form,
40 HttpServletRequest request,
41 HttpServletResponse response)
42 throws Exception
43 {
44 // Minimal check for valid session.
45 //super.checkSession(request, mapping);
46
47 logger.info("Logging out user.");
48 logger.debug("Invalidating session.");
49
50 ServletAuthentication.invalidateAll(request);
51
52 // Return to MedRec start page.
53 return mapping.findForward("medrec.startpage");
54 }
55 }
|