C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers


10,705 users

When to use <ui:include>, tag files, composite components and/or custom components?

0 votes
I started using JSF 2.0 with Facelets recently and got puzzled by new composite components knowing existing <ui:include> and other templating techniques offered by Facelets 1.x.
asked Jan 23, 2014 by john Guru (27,140 points)

1 Answer

0 votes


Use Facelet templates (as in <ui:include> and/or <ui:composition>) if you want to split main page layout fragments into reuseable templates. E.g. header, menu, footer, etc.
Use Facelet tag files if you want to have a reuseable group of components in order to prevent/minimize code duplication. E.g. a group of label+input+message components. The major difference with composite components is that the output of a Facelet tag file does not represent a single UIComponent and may in some circumstances be the only solution when a composite component doesn't suffice.
answered Jan 23, 2014 by keem Expert (13,240 points)

Related questions

0 votes
2 answers 21 views
21 views asked Jan 20, 2014 by john Guru (27,140 points)
0 votes
1 answer 106 views
0 votes
1 answer 113 views
0 votes
1 answer 102 views
102 views asked Jan 3, 2014 by smith Geek (15,340 points)
0 votes
2 answers 48 views
48 views asked Jan 21, 2014 by john Guru (27,140 points)