Introduction to JavaServer Faces - JSF


1. What is JSF


JavaServer Faces (JSF) is a UI component based Java Web 

application framework. JSF is serverbased, e.g. the JSF UI 

components and their state are represented on the server with 

a defined life-cycle of the UI components. JSF is part of the 

Java EE standard.




2. Prerequisites to use JSF


To use JSF you need:

  • JSF Implementation (in the form of the JSF jars)
  • The JSTL tags library
  • A Java runtime environment
  • A web-container to use JSF in (for example Tomcat)

3. JSF Main features


JSP has the following main features:

1.JSP is based on the Model-View-Controller concept

2.JSP has a stateful UI component model, e.g. each 

    component is aware of its data.

3.JSF separates the functionality of a component from 

    the display of the component. The renderer is responsible 

    of displaying the component for a certain client. This renderer 

    can get exchanged. The standard renderer for JSF components 

    is the HTML renderer.

4.JSP support listeners on UI components

5.JSP support data validation, data binding and data conversion 

    between the UI and the model

4. JSF configuration files


4.1. Overview

JSF is based on the following configuration files:
  • web.xml - General web application configuration file
  • faces-config.xml - Contains the configuration of the JSF application.

4.2. web.xml

JSF requires the central configuration list web.xml in the

directory WEB-INF of the application. This is similar to other

 web-applications which are based on servlets.You must specify

 in web.xml that a 

1.FacesServlet is responsible for handling JSF applications. 

2.FacesServlet is the central controller for the JSF application.

3.FacesServlet receives all requests for the JSF application 

and initializes the JSF components before the JSP is displayed.


4.3. faces-config.xml

"faces-config.xml" allows to configure the application, managed

beans, convertors, validators, and navigation.


Reference :-



Related Post











Comments