add(header);
Response orgResponse = getRequestCycle().getResponse();
try
{
final StringResponse response = new StringResponse();
getRequestCycle().setResponse(response);
// Render all header sections of all components on the page
renderHead(header);
// Make sure all Components interested in contributing to the header
// and there attached behaviors are asked.
final HtmlHeaderContainer finalHeader = header;
visitChildren(new IVisitor<Component, Void>()
{
/**
* @see org.apache.wicket.IVisitor#component(org.apache.wicket.Component)
*/
public void component(final Component component, final IVisit<Void> visit)
{
component.renderHead(finalHeader);
}
});
response.close();
if (response.getBuffer().length() > 0)
{
// @TODO it is not yet working properly. JDo to fix it
log.error("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
log.error("You probably forgot to add a <body> or <head> tag to your markup since no Header Container was \n" +
"found but components were found which want to write to the <head> section.\n" +
response.getBuffer());
log.error("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
}
}
catch (Exception e)
{