// Only <head> component tags have the id == "_header"
if (tag.getId().equals(HtmlHeaderSectionHandler.HEADER_ID))
{
// Create a special header component which will gather additional
// input the <head> from 'contributors'.
final WebMarkupContainer header = new HtmlHeaderContainer(
HtmlHeaderSectionHandler.HEADER_ID + container.getPage().getAutoIndex());
container.autoAdd(header, markupStream);
// Yes, we handled the tag
return true;
}
else if ((tag instanceof WicketTag) && ((WicketTag)tag).isHeadTag())
{
// If we found <wicket:head> without surrounding <head> on a Page,
// than we have to add wicket:head into a automatically generated
// head first.
if (container instanceof WebPage)
{
// Create a special header component which will gather
// additional input the <head> from 'contributors'.
final MarkupContainer header = new HtmlHeaderContainer(
HtmlHeaderSectionHandler.HEADER_ID + container.getPage().getAutoIndex());
// It is <wicket:head>. Because they do not provide any
// additional functionality they are merely a means of surrounding relevant
// markup. Thus we simply create a WebMarkupContainer to handle
// the tag.
final WebMarkupContainer header2 = new WebMarkupContainer(
HtmlHeaderSectionHandler.HEADER_ID)
{
private static final long serialVersionUID = 1L;
public boolean isTransparentResolver()
{
return true;
}
};
header2.setRenderBodyOnly(true);
header.add(header2);
container.autoAdd(header, markupStream);
}
else if (container instanceof HtmlHeaderContainer)
{
// It is <wicket:head>. Because they do not provide any
// additional functionality there are merely a means of surrounding
// relevant markup. Thus we simply create a WebMarkupContainer to handle
// the tag.
final WebMarkupContainer header = new WebMarkupContainer(
HtmlHeaderSectionHandler.HEADER_ID)
{
private static final long serialVersionUID = 1L;
public boolean isTransparentResolver()
{
return true;
}
};
header.setRenderBodyOnly(true);
try
{
container.autoAdd(header, markupStream);
}