Search code examples
jsf-2faceletsuiinclude

Is it possible to ui:include files from an absolute file path rather than relative webapp path?


Suppose I have the following in my JSF page:

<ui:include src="/WEB-INF/templates/footer.xhtml"></ui:include>

If this is changing to be static content loading from a non-webapp path - is is possible to change my ui:include to an absolute path on the file system?

Assumptions:

  • Mojarra 2.0
  • Java 7.0
  • Tomcat 7.0

Solution

  • On a mac (for example) the path look like this:

    <ui:include src="file:///Users/Julian/Documents/.../WEB-INF/templates/footer.xhtml" />
    

    On Windows the path looks like this:

    <ui:include src="file:///C:/Users/.../footer.xhtml" />