if (hstDispURL != null) { HstPortletResponseState portletResponseState = new HstPortletResponseState(request, response); request.setAttribute(HstResponseState.class.getName(), portletResponseState); portletResponseState.flush(); String redirectLocationUrl = portletResponseState.getRedirectLocation(); if (redirectLocationUrl != null) { if (portletResponseState.isRenderRedirect()) { HstRequestContext rc = (HstRequestContext)request.getAttribute(ContainerConstants.HST_REQUEST_CONTEXT); if (!redirectLocationUrl.startsWith(rc.getEmbeddingContextPath())) {
protected void processActionResponseState(ActionRequest request, ActionResponse response, String hstDispUrl, HstPortletResponseState portletResponseState) throws PortletException, IOException { PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher(hstDispUrl); if (dispatcher != null) { dispatch(dispatcher, request, response, true); // write out Cookies to ActionResponse portletResponseState.flush(); String redirectLocationUrl = portletResponseState.getRedirectLocation(); if (redirectLocationUrl != null) { if (portletResponseState.isRenderRedirect()) { response.setRenderParameter(HST_PATH_PARAM_NAME + request.getPortletMode().toString(), redirectLocationUrl); } else { response.sendRedirect(redirectLocationUrl); } } } else { throw new PortletException("HST URL Dispatcher is not found: " + hstDispUrl); } }
HstPortletResponseState portletResponseState = new HstPortletResponseState(request, response); request.setAttribute(HstResponseState.class.getName(), portletResponseState); if (portletResponseState.isActionResponse()) { processActionResponseState((ActionRequest) request, (ActionResponse) response, hstDispUrl, portletResponseState); } else if (portletResponseState.isMimeResponse()) {
@Override public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { String hstDispURL = resolveEmbeddedDispatchURL(request, response); if (hstDispURL != null) { HstResponseState portletResponseState = new HstPortletResponseState(request, response); request.setAttribute(HstResponseState.class.getName(), portletResponseState); PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher(hstDispURL); if (dispatcher != null) { dispatcher.include(request, response); portletResponseState.flush(); } } }
protected void processMimeResponseRequest(PortletRequest request, MimeResponse response, String hstDispUrl, HstPortletResponseState portletResponseState) throws PortletException, IOException { PortletRequestDispatcher dispatcher = this.portletContext.getRequestDispatcher(hstDispUrl); if (dispatcher != null) { dispatch(dispatcher, request, response, true); portletResponseState.flush(); } }
if (mount != null && mount.getSiteMount().isSiteMount()) { ((HstPortletResponseState)responseState).setRenderRedirect(true);
@Override public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException { if (!PortletConfigUtils.isEmpty(request.getResourceID())) { // only handle serveResource by ResourceID parameter HstMutablePortletRequestContext prc = createHstRequestContext(request, response); if (prc != null) { HstPortletResponseState portletResponseState = new HstPortletResponseState(request, response); processMimeResponseRequest(request, response, request.getResourceID(), portletResponseState); } } }
@Override public void serveResource(ResourceRequest request, ResourceResponse response) throws PortletException, IOException { if (request.getResourceID() != null && resolveEmbeddedDispatchURL(request,response) != null) { // only handle serveResource by ResourceID parameter HstResponseState portletResponseState = new HstPortletResponseState(request, response); PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher(request.getResourceID()); if (dispatcher != null) { dispatcher.include(request, response); portletResponseState.flush(); } } }