@Override public void sendRedirect(String redirect) throws IOException { String portalURL = PortalUtil.getPortalURL(_request); if (redirect.charAt(0) == CharPool.SLASH) { if (Validator.isNotNull(portalURL)) { redirect = portalURL.concat(redirect); } } if (!CookieKeys.hasSessionId(_request) && redirect.startsWith(portalURL)) { redirect = PortalUtil.getURLWithSessionId(redirect, _request.getSession().getId()); } _request.setAttribute(AbsoluteRedirectsResponse.class.getName(), redirect); super.sendRedirect(redirect); }
private String _getURL( HttpServletRequest request, boolean resetMaxState, boolean resetRenderParameters) throws PortalException, SystemException { ThemeDisplay themeDisplay = (ThemeDisplay) request.getAttribute(WebKeys.THEME_DISPLAY); if (resetMaxState) { Layout layout = themeDisplay.getLayout(); LayoutTypePortlet layoutTypePortlet = null; if (layout.equals(this)) { layoutTypePortlet = themeDisplay.getLayoutTypePortlet(); } else { try { layoutTypePortlet = _getLayoutTypePortletClone(request); } catch (IOException ioe) { _log.error("Unable to clone layout settings", ioe); layoutTypePortlet = (LayoutTypePortlet) getLayoutType(); } } if (layoutTypePortlet.hasStateMax()) { String portletId = StringUtil.split(layoutTypePortlet.getStateMax())[0]; PortletURLImpl portletURLImpl = new PortletURLImpl(request, portletId, getPlid(), PortletRequest.ACTION_PHASE); try { portletURLImpl.setWindowState(WindowState.NORMAL); portletURLImpl.setPortletMode(PortletMode.VIEW); } catch (PortletException pe) { throw new SystemException(pe); } portletURLImpl.setAnchor(false); if (PropsValues.LAYOUT_DEFAULT_P_L_RESET && !resetRenderParameters) { portletURLImpl.setParameter("p_l_reset", "0"); } else if (!PropsValues.LAYOUT_DEFAULT_P_L_RESET && resetRenderParameters) { portletURLImpl.setParameter("p_l_reset", "1"); } return portletURLImpl.toString(); } } String url = PortalUtil.getLayoutURL(this, themeDisplay); if (!CookieKeys.hasSessionId(request)) { url = PortalUtil.getURLWithSessionId(url, request.getSession().getId()); } if (!resetMaxState) { return url; } if (PropsValues.LAYOUT_DEFAULT_P_L_RESET && !resetRenderParameters) { url = HttpUtil.addParameter(url, "p_l_reset", 0); } else if (!PropsValues.LAYOUT_DEFAULT_P_L_RESET && resetRenderParameters) { url = HttpUtil.addParameter(url, "p_l_reset", 1); } return url; }