Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>In JSF 2 (i.e. in Facelets), a template is a static piece of content that can have dynamic content composed within it.</p> <p>If you want to use a different template, firstly you have to point to a different page with a different URL path, then the different page can use a different template:</p> <pre><code>&lt;ui:include src="./header{$HeaderTemplateSuffix}.xhtml" /&gt; </code></pre> <p>Then headerABC.xml can have:</p> <pre><code>... &lt;ui:composition ... template="http://someserver/somefileABC"&gt; ... </code></pre> <p>and headerDEF.xml can have</p> <pre><code>... &lt;ui:composition ... template="http://someserver/somefileDEF"&gt; ... </code></pre> <p>Alternatively, you could abandon using templates against headers, and generate all header content dynamically (even including the static parts).</p> <p>Note: merging html header template back into the main template is NOT a solution to this problem, because it doesn't address the core challenge of the header template being <em>dynamic</em>.</p> <p>Hope that helps! Cheers :^)</p> <hr> <p>Note: it is possible to set the following in web.xml:</p> <pre><code>&lt;!-- Time in seconds that facelets should be checked for changes since last request. A value of -1 disables refresh checking. --&gt; &lt;context-param&gt; &lt;param-name&gt;javax.faces.FACELETS_REFRESH_PERIOD&lt;/param-name&gt; &lt;param-value&gt;0&lt;/param-value&gt; &lt;/context-param&gt; &lt;!-- Set the project stage to "Development", "UnitTest", "SystemTest", or "Production". --&gt; &lt;!-- An optional parameter that makes troubleshooting errors much easier. --&gt; &lt;!-- You should remove this context parameter before deploying to production! --&gt; &lt;context-param&gt; &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt; &lt;param-value&gt;Development&lt;/param-value&gt; &lt;/context-param&gt; </code></pre> <p>HOWEVER, that is intended to serve a whole different purpose: to allow the developer to change any static resource on-the-fly and the JSF container will dynamically check for changes and load it during development. It is not an intention that you use this to simulate dynamic templating, and setting the above properties will have a negative impact on performance and secure behaviour in your Production environment.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload