Description
With DecoratingHeaderResponse and few supporting classes it is possible currently to group and filter header contributions, e.g. to render all JavaScript resources just before the closing tag of the body (</body>). See http://www.wicket-library.com/wicket-examples/resourceaggregation for an example in action.
Unfortunately it is not possible to use the grouping feature in the <head> tag currently because HtmlHeaderContainer first renders its body and then asks for other components' header contributions. While rendering its body it tries to render the placeholder for the header group and fails at org.apache.wicket.resource.filtering.HeaderResponseFilteredResponseContainer.onComponentTagBody(MarkupStream, ComponentTag) saying that the IHeaderResponse is not closed yet.
To allow this I'm suggesting a patch that will first collect other components' header contribution, then close the IHeaderResponse and finally collect the <head>'s body. At the end it will render the head's body first and then the header contributions as it is now.