I am basically having a Template I want to reuse for several of my pages. They all have a look and feel in common where they share a menu that allows them to login and navigate to a Home page. The issue is with the Home page:
- When there exists an
index(index.xhtml) local to the current page (not the template), then use that as the default. When my template is called from/tools/page(/tools/page.xhtml), then it will point to/tools/index(/tools/index.xthml). With relative path, I can drop the/tools. - Fall back to
/index(/index.xhtml).
Example:
<p:menubar>
<p:menuitem icon="fa fa-home" outcome="/index" value="Home"
rendered="#{not outcomeExists('index')}" />
<p:menuitem icon="fa fa-home" outcome="index" value="Home"
rendered="#{outcomeExists('index')}" />
<p:menuitem icon="fa fa-user" value="#{login.name}"/>
</p:menubar>
Of course, I want to translate true JSF Navigation rules for testing if it exists or not, so it will automatically look for index.xhtml, index.jsf, etc.