if (log.isDebugEnabled())
{
log.debug("renderHead: " + toString(false));
}
IHeaderResponse response = container.getHeaderResponse();
// Allow component to contribute
if (response.wasRendered(this) == false)
{
// Make sure the markup source strategy contributes to the header first
// to be backward compatible. WICKET-3761
getMarkupSourcingStrategy().renderHead(this, container);
// Then let the component itself to contribute to the header
renderHead(this, response);
response.markRendered(this);
}
// Than ask all behaviors
for (Behavior behavior : getBehaviors())
{
if (isBehaviorAccepted(behavior))
{
if (response.wasRendered(behavior) == false)
{
behavior.renderHead(this, response);
response.markRendered(behavior);
}
}
}
}
}