Sziasztok,
Liferay 5.1.2-ben dolgozunk, amiben azt szeretnénk megoldani, hogy a userk bejelentkezés után egy fixen meghatározott oldalra legyenek továbbítva.
Szimplán a portal-ext.properties-ben megadott "default.landing.page.path" beállítása nem hozott eredményt.
Készült egy Custom login post action, amit debugolva láthatóan a LastPath értékek beállítása megtörténik, mégsem lesz belőle redirect:
portal-ext.properties1default.landing.page.path=/web/guest/wall
2auth.forward.by.last.path=true
3login.events.post=com.liferay.portal.events.DefaultLandingPageAction,com.liferay.portal.events.CustomLoginPostAction
CustomLoginPostAction 1public class CustomLoginPostAction extends Action {
2
3 private static Log _log = LogFactoryUtil.getLog(CustomLoginPostAction.class);
4
5 public void run(HttpServletRequest req, HttpServletResponse res) throws ActionException {
6 try {
7
8 HttpSession ses = req.getSession();
9 Map params = new HashMap();
10
11 User loginUser =
12 UserLocalServiceUtil.getUser(com.liferay.portal.util.PortalUtil.getUserId(req));
13
14 LastPath lastPath = null;
15
16 if (loginUser == null) {
17 lastPath = new LastPath("/c", "/portal/layout", params);
18 } else {
19 lastPath = new LastPath("", "/web/guest/wall", params);
20 }
21
22 ses.setAttribute(WebKeys.LAST_PATH, lastPath);
23 } catch (Exception e) {
24 throw new ActionException(e);
25 }
26 }
27}
Milyen alternatíva jöhet még szóba?
Bitte melden Sie sich an, um diesen Inhalt als unangebracht zu kennzeichnen.