Hi,
I know you found a solution, I just wanted to add an example that doesn't use strings concatenation.
1
2 public void run(HttpServletRequest request, HttpServletResponse response)
3 throws ActionException {
4
5 String path = "";
6 // attempt to get path to User private page
7 User user = UserLocalServiceUtil.getUser(PortalUtil.getUserId(request));
8 // check for private layouts
9 if (LayoutLocalServiceUtil.hasLayouts(user, true)) {
10 List<Layout> layouts = LayoutLocalServiceUtil.getLayouts(user.getGroupId(), true);
11 if (layouts.size()>1){
12 _log.info("More then 1 private layout found for User while max. 1 is assumed. The last layout is returned.");
13 }
14 for (Layout layout : layouts) {
15 path = PortalUtil.getLayoutActualURL(layout);
16 }
17 }
18
19 if (Validator.isNotNull(path)) {
20 LastPath lastPath = new LastPath(StringPool.BLANK, path,new HashMap<String, String[]>());
21 HttpSession session = request.getSession();
22 session.setAttribute(WebKeys.LAST_PATH, lastPath);
23 }
24 }
I used this in a post login hook where ThemeDisplay isn't available.