One of the most common techniques for implementing the Composite View design pattern is the Server Side Include (SSI) technique. JSP supports the
<jsp:include> server-side include element, and Facelets provides similar functionality through the
<ui:include> tag. The tag's
src attribute can be used to specify the path of a Facelets page to be included at request time. This technique enables us to externalize common view elements such as headers and footers as separate files and to reuse these by including them in other pages throughout our application.
The following example demonstrates how to create a simple composite view using the SSI approach. The header and footer files are included ...