In this blog, I am going to touch the following concepts.
1. What is JSF
2. JSF Terminology
3. JSF life cycle
4. Facelets - Included in JSF 2.0
5. Custom components
7. Component libraries
What is JSF
JavaServer Faces (JSF) is a Java specification for building component-based user interfaces for
It's a standard Java EE web framework.
Well-designed and easy-to-use component-based webframework.
JSF is based on well established MVC design pattern.
The following terminology is used in JSF
1. UI Components
4. Backing Beans
6. Events and Listeners
Backing Beans are specialized JavaBeans that collect values from UI Components and implement the event
listeners. Backing Beans control and define the interaction between the UI and the model.
JSF life cycle
There are 6 phases in JSF application lifecycle.
1) Restore view
2) Apply request values
3) Process validations
4) Update model values
5) Invoke application
6) Render response
|JSF life cycle|
Facelets is a view technology for JSF.
Support for code reuse through templating and composite components.
Faster compilation time.
High performance rendering.
In JSF, a component is a group of interacting classes that together provide a reusable piece of web-based
user interface code.
A component is made up of three classes that work closely together.
1) Renderer - which creates the client-side representation of the component and takes any input
from the client and transforms it into something the component can understand
2) UIComponent subclass - This class is responsible for the data and behavior of the component on
the server side.
3) JSP custom action – The main functions of this class are to allow for configuration of the
component in a JSP and to attach a particular renderer to the component.
By using ajax support you can update JSF elements (h:outputText, h:inputText, h:selectOneMenu, etc.) from
f:ajax tag is used in JSF.
JSF component libraries just adds extra features on top of the basic implementation, They are like
skinnability, ajaxability, enhanceability.
There are lot of JSF component libraries
1. JSF is based on well established Model-View-Controller (MVC) design pattern.
2. Applications developed using JSF frameworks are well designed and easy to maintain then any other
applications developed in JSP and Servlets.
3. JSF provides standard, reusable components for creating user interfaces for web applications.
4. JSF provides many tag libraries for accessing and manipulating the components.
5. JSF is a specification and vendors can develop the implementations for JSF.
JSR-000127 JavaServerTM Faces (Final Release) - http://jcp.org/aboutJava/communityprocess/final/jsr127/