Introduction to Facelets

In this section, you will find the brief introduction of Facelets technology of JSF.

Introduction to Facelets

Introduction to Facelets

In this section, you will find the brief introduction of Facelets technology of JSF.

The Facelets is the presentation technology for the JSF for developing web based application. Facelets is page declaration language for the Java Server Faces which is used to build views for JSF by utilizing HTML style template. It also used to build component trees.

Features of Facelets

  • For create web pages you can use XHTML.

  • In addition to JSF tag library and JSTL tag library you can utilize Facelets tag library.

  •  It also supports Expression Language (EL).

  • Provides components and pages Template.

Facelets Advantages

  • Enhance code reusability via templating and composite components.

  • It also extends functionality of components and other server-side objects via customization.

  • It has faster compilation time.

  • EL validation during compile time.

  • Provide excellent rendering.

HOW TO USE

For using JSF Facelets tag library, you need to include its URI into HTML tag as follows :

<html xmlns="http://www.w3.org/1999/xhtml" 
         xmlns:h="http://java.sun.com/jsf/html"
         xmlns:ui="http://java.sun.com/jsf/facelets">

You need to put ui : prefix before using its tags. Some of the examples are given below :

  • ui : insert

  • ui : define

  • ui : include

  • ui : composition

  • ui : component