What is the difference between <f:subview>
and <ui:composition>
tags? For what purposes and cases are each of these tags suiteble for?
The <f:subview>
introduces a new NamingContainer
layer and has initially (in JSF 1.0) been designed to be used in combination with JSP's <jsp:include>
tag.
<f:subview id="foo">
<jsp:include page="/WEB-INF/include.jsp" />
</f:subview>
In JSF 2.0, which uses Facelets instead of JSP as default view technology, this tag has not really a value anymore.
The <ui:composition>
, which is from JSP's successor Facelets, definies a template composition and allows the developers to design the HTML template in visual HTML editors like Dreamweaver. When actually used in a JSF/Facelets environment, any content outside <ui:composition>
will be disregarded and only the inner content will be used to build the component tree. This tag can be used in both the include pages and template clients. See also How to include another XHTML in XHTML using JSF 2.0 Facelets?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With