1
14
15 package com.liferay.portal.events;
16
17 import com.liferay.portal.kernel.events.Action;
18 import com.liferay.portal.kernel.events.ActionException;
19 import com.liferay.portal.kernel.log.Log;
20 import com.liferay.portal.kernel.log.LogFactoryUtil;
21 import com.liferay.portal.kernel.util.PropsKeys;
22 import com.liferay.portal.kernel.util.StringPool;
23 import com.liferay.portal.kernel.util.Validator;
24 import com.liferay.portal.struts.LastPath;
25 import com.liferay.portal.util.PortalUtil;
26 import com.liferay.portal.util.PrefsPropsUtil;
27 import com.liferay.portal.util.WebKeys;
28
29 import java.util.HashMap;
30
31 import javax.servlet.http.HttpServletRequest;
32 import javax.servlet.http.HttpServletResponse;
33 import javax.servlet.http.HttpSession;
34
35
40 public class DefaultLogoutPageAction extends Action {
41
42 public void run(HttpServletRequest request, HttpServletResponse response)
43 throws ActionException {
44
45 try {
46 doRun(request, response);
47 }
48 catch (Exception e) {
49 throw new ActionException(e);
50 }
51 }
52
53 protected void doRun(
54 HttpServletRequest request, HttpServletResponse response)
55 throws Exception {
56
57 long companyId = PortalUtil.getCompanyId(request);
58
59 String path = PrefsPropsUtil.getString(
60 companyId, PropsKeys.DEFAULT_LOGOUT_PAGE_PATH);
61
62 if (_log.isInfoEnabled()) {
63 _log.info(
64 PropsKeys.DEFAULT_LOGOUT_PAGE_PATH + StringPool.EQUAL + path);
65 }
66
67 if (Validator.isNotNull(path)) {
68 LastPath lastPath = new LastPath(
69 StringPool.BLANK, path, new HashMap<String, String[]>());
70
71 HttpSession session = request.getSession();
72
73 session.setAttribute(WebKeys.LAST_PATH, lastPath);
74 }
75
76
81
88 }
89
90 private static Log _log = LogFactoryUtil.getLog(
91 DefaultLogoutPageAction.class);
92
93 }