In template you can use ui:insert
, for example
<ui:insert name="footer">
<ui:include src="/WEB-INF/template/footer.xhtml" />
</ui:insert>
In your view you can redefine it: <ui:define name="footer"></ui:define>
(no footer) or include other file.
If you need support ajax, then you can use ui:fragment
. It has rendered
attribute which can be used for displaying content (you can have more than 1 fragment).