public int doEndTag() throws JspException { try { // if hstRequest is retrieved, then this servlet has been dispatched by hst component. HstResponse hstResponse = (HstResponse) pageContext.getRequest().getAttribute(ContainerConstants.HST_RESPONSE); if (hstResponse == null && pageContext.getResponse() instanceof HstResponse) { hstResponse = (HstResponse) pageContext.getResponse(); } List<Element> headElements = hstResponse != null ? hstResponse.getHeadElements() : null; if (headElements == null) { return SKIP_BODY; } for (Element headElement : headElements) { if (shouldBeIncludedInOutput(headElement)) { outputHeadElement(headElement); hstResponse.addProcessedHeadElement(headElement); } } try { pageContext.getOut().flush(); } catch (IOException e) { throw new JspException("Cannot flush the output", e); } return SKIP_BODY; } finally { cleanup(); } }
List<Element> headElements = hstResponse.getHeadElements();
if (!childWindow.getResponseState().isFlushed() && !childWindow.getComponentInfo().isSuppressWasteMessage() && StringUtils.isNotBlank(getRenderer(childWindow, childResponseImpl))) { if (childResponse.getHeadElements() == null || childResponse.getHeadElements().isEmpty()) {