}
// If a <head> tag is missing, insert it automatically
if ((hasOpenWicketHead != -1) && (hasHead == -1))
{
final XmlTag headOpenTag = new XmlTag();
headOpenTag.setName("head");
headOpenTag.setType(TagType.OPEN);
final ComponentTag openTag = new ComponentTag(headOpenTag);
openTag.setId(HtmlHeaderSectionHandler.HEADER_ID);
openTag.setAutoComponentTag(true);
final XmlTag headCloseTag = new XmlTag();
headCloseTag.setName(headOpenTag.getName());
headCloseTag.setType(TagType.CLOSE);
final ComponentTag closeTag = new ComponentTag(headCloseTag);
closeTag.setOpenTag(openTag);
closeTag.setId(HtmlHeaderSectionHandler.HEADER_ID);
addMarkupElement(hasOpenWicketHead, openTag);