private static void setupMetaAndTitle(Element head, BootstrapContext context) { head.appendElement(META_TAG).attr("http-equiv", "Content-Type").attr( CONTENT_ATTRIBUTE, ApplicationConstants.CONTENT_TYPE_TEXT_HTML_UTF_8); head.appendElement(META_TAG).attr("http-equiv", "X-UA-Compatible") .attr(CONTENT_ATTRIBUTE, "IE=edge"); head.appendElement("base").attr("href", getServiceUrl(context)); head.appendElement(META_TAG).attr("name", VIEWPORT) .attr(CONTENT_ATTRIBUTE, BootstrapUtils .getViewportContent(context).orElse(Viewport.DEFAULT)); if (!BootstrapUtils.getMetaTargets(context).isEmpty()) { BootstrapUtils.getMetaTargets(context) .forEach((name, content) -> head.appendElement(META_TAG) .attr("name", name) .attr(CONTENT_ATTRIBUTE, content)); } resolvePageTitle(context).ifPresent(title -> { if (!title.isEmpty()) { head.appendElement("title").appendText(title); } }); }