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

3,749 questions

4,049 answers

114 comments

10,705 users

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

0 votes
23 views
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 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 by keem Expert (13,240 points)

Related questions

0 votes
2 answers 22 views
0 votes
1 answer 116 views
0 votes
1 answer 108 views
0 votes
2 answers 49 views
...