Building UI with template's features using JSF
The JavaServer Faces (JSF) is a powerful Java EE API for building outstanding UIs, using both client and server features.
It goes much further than when you are using JSP, as you are not only using Java code inside HTML code, but actually really referencing code injected in the server context.
This recipe will show you how to use the Facelet's template feature to get more flexibility and reusability from your layout template.
Getting ready
Start by adding the dependency to your project:
<dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>8.0</version> <scope>provided</scope> </dependency>
How to do it...
- Let's first create our page layout with a header, content section, and footer:
<h:body> <div id="layout"> <div id="header"> <ui:insert name="header" >...