Wednesday, 18 September 2013

JSF Facelets how to include external html?

JSF Facelets how to include external html?

I have an app that i'm developing and my company has a header banner that
is required to be on all pages. We have about 6 different versions
floating around my team of that header banner and I now want to make it so
that I just include the banner from the source into my app so that if they
update the source of the banner, my app's version of the banner is
automatically updated as well.
using <ui:include src="http://mycompany.com/banner.html" /> causes the
error The markup in the document following the root element must be
well-formed..
How can i include this banner even if it's not well formed xml?
My current template:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition>
<h:body>
<div>
<ui:include src="http://mycompany.com/banner.html" />
</div>
<ui:insert name="content" />
</h:body>
</ui:composition>
</html>

No comments:

Post a Comment