Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between <f:subview> and <ui:composition> tags

Tags:

jsf

What is the difference between <f:subview> and <ui:composition> tags? For what purposes and cases are each of these tags suiteble for?

like image 706
theendrew Avatar asked Feb 14 '12 08:02

theendrew


1 Answers

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?

like image 96
BalusC Avatar answered Sep 27 '22 16:09

BalusC