[ https://issues.apache.org/jira/browse/WICKET-6617?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16706516#comment-16706516 ]
ASF GitHub Bot commented on WICKET-6617: ---------------------------------------- Github user solomax commented on a diff in the pull request: https://github.com/apache/wicket/pull/343#discussion_r238121519 --- Diff: wicket-core/src/main/java/org/apache/wicket/markup/html/internal/HtmlHeaderContainer.java --- @@ -161,19 +161,19 @@ public final void onComponentTagBody(MarkupStream markupStream, ComponentTag ope final StringResponse response = new StringResponse(); getRequestCycle().setResponse(response); - IHeaderResponse headerResponse = getHeaderResponse(); - if (!response.equals(headerResponse.getResponse())) - { - getRequestCycle().setResponse(headerResponse.getResponse()); - } + try (IHeaderResponse headerResponse = getHeaderResponse()) { + if (!response.equals(headerResponse.getResponse())) + { + getRequestCycle().setResponse(headerResponse.getResponse()); + } - // Render the header sections of all components on the page - AbstractHeaderRenderStrategy.get().renderHeader(this, - new HeaderStreamState(markupStream, openTag), getPage()); + // Render the header sections of all components on the page + AbstractHeaderRenderStrategy.get().renderHeader(this, + new HeaderStreamState(markupStream, openTag), getPage()); - // Close the header response before rendering the header container itself - // See https://issues.apache.org/jira/browse/WICKET-3728 - headerResponse.close(); --- End diff -- `close()` is being called automatically by `try with resource` statement I'll modify comment > Header contribution ignore <wicket:header-items/> > ------------------------------------------------- > > Key: WICKET-6617 > URL: https://issues.apache.org/jira/browse/WICKET-6617 > Project: Wicket > Issue Type: Bug > Components: wicket-core > Affects Versions: 8.2.0 > Reporter: Maxim Solodovnik > Assignee: Maxim Solodovnik > Priority: Major > > Components added via AJAX and contributing to <head> using @Override > renderHead ignores <wicket:header-items/> if any -- This message was sent by Atlassian JIRA (v7.6.3#76005)