public void flushChildContent(String name) throws IOException { HstComponentWindow childWindow = this.componentWindow.getChildWindow(name); if (childWindow != null) { childWindow.getResponseState().flush(); } }
public void flushChildContent(String name, Writer writer) throws IOException { HstComponentWindow childWindow = this.componentWindow.getChildWindow(name); if (childWindow == null) { log.debug("Cannot find child window with name '{}' for current window '{}'. Skip child.", name, this.componentWindow.getName()); } else { childWindow.getResponseState().flush(writer); } }
traceToolWindowFlushed = true; if (traceToolWindow != null) { traceToolWindow.getResponseState().flush();
@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(); } } }
/** * Write the aggregated output to the client. e.g, by flushing the {@code rootRenderingWindow} by default. * @param context {@link ValveContext} instance * @param rootRenderingWindow the root rendering {@link HstComponentWindow} instance * @throws ContainerException if HST Container exception occurs */ protected void writeAggregatedOutput(final ValveContext context, final HstComponentWindow rootRenderingWindow) throws ContainerException { final HstRequestContext requestContext = context.getRequestContext(); try { // add the X-HST-VERSION as a response header if we are in preview: boolean isPreviewOrCmsRequest = requestContext.isPreview() || requestContext.isCmsRequest(); if (isPreviewOrCmsRequest) { final HttpServletResponse servletResponse = context.getServletResponse(); setNoCacheHeaders(servletResponse); if (requestContext.getResolvedMount().getMount().isVersionInPreviewHeader()) { servletResponse.setHeader("X-HST-VERSION", HstServices.getImplementationVersion()); } } // flush root component window content. // note that the child component's contents are already flushed into the root component's response state. rootRenderingWindow.getResponseState().flush(); } catch (Exception e) { if (log.isDebugEnabled()) { log.warn("Exception during flushing the response state.", e); } else if (log.isWarnEnabled()) { log.warn("Exception during flushing the response state. {}", e.toString()); } } }
@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(); } } }
window.getResponseState().flush(true);
responseState.flush();
responseState.flush();