Wednesday, October 26, 2011

Facelets Tutorial Highlights

Facelets Tutorial Highlights from here.

The term Facelets refers to the view declaration language for JavaServer Faces technology. JavaServer Pages (JSP) technology, previously used as the presentation technology for JavaServer Faces, does not support all the new features available in JavaServer Faces 2.0. JSP technology is considered to be a deprecated presentation technology for JavaServer Faces 2.0. Facelets is a part of the JavaServer Faces specification and also the preferred presentation technology for building JavaServer Faces technology-based applications.

What Is Facelets?




Facelets is a powerful but lightweight page declaration language that is used to build JavaServer Faces views using HTML style templates and to build component trees. Facelets features include the following:

  • Use of XHTML for creating web pages

  • Support for Facelets tag libraries in addition to JavaServer Faces and JSTL tag libraries

  • Support for the Expression Language (EL)

  • Templating for components and pages


JavaServer Faces technology supports various tag libraries to add components to a web page. To support the JavaServer Faces tag library mechanism, Facelets uses XML namespace declarations. Table 5-1 lists the tag libraries supported by Facelets.



Table 5-1 Tag Libraries Supported by Facelets













































Tag LibraryURIPrefixExampleContents
JavaServer Faces Facelets Tag Libraryhttp://java.sun.com/jsf/faceletsui:ui:component

ui:insert
Tags for templating
JavaServer Faces HTML Tag Libraryhttp://java.sun.com/jsf/htmlh:h:head

h:body

h:outputText

h:inputText
JavaServer Faces component tags for all UIComponents
JavaServer Faces Core Tag Libraryhttp://java.sun.com/jsf/coref:f:actionListener

f:attribute
Tags for JavaServer Faces custom actions that are independent of any particular RenderKit
JSTL Core Tag Libraryhttp://java.sun.com/jsp/jstl/corec:c:forEach

c:catch
JSTL 1.1 Core Tags
JSTL Functions Tag Libraryhttp://java.sun.com/jsp/jstl/functionsfn:fn:toUpperCase

fn:toLowerCase
JSTL 1.1 Functions Tags

In addition, Facelets supports tags for composite components for which you can declare custom prefixes. For more information on composite components, see Composite Components.

No comments:

Post a Comment