What is JSF (JavaServer Faces)?

By: Baski Emailed: 1642 times Printed: 2109 times    

Latest comments
By: rohit kumar - how this program is work
By: Kirti - Hi..thx for the hadoop in
By: Spijker - I have altered the code a
By: ali mohammed - why we use the java in ne
By: ali mohammed - why we use the java in ne
By: mizhelle - when I exported the data
By: raul - no output as well, i'm ge
By: Rajesh - thanx very much...
By: Suindu De - Suppose we are executing

A complete web application requires a web framework to generate HTML pages, receive user input, and manage the navigation flow. The consensus among most web developers is that a Model-View-Controller (MVC) architecture is the best for web frameworks. In an MVC framework, the controller takes user input and decides which view to show next; The view renders the HTML page for the browser; The model encapsulates data captured from the web form and to be displayed on the web page.

There are many web frameworks available. JavaServer Faces (JSF), is the standard Java EE web framework . While JSF does have a leg up on the competition by being a standards-based technology, the decision to embrace JSF over the alternatives goes much deeper.

JSF is a well-designed and easy-to-use component-based web framework. This component-based development model aligns perfectly with the lightweight POJO approach we are promoting. The development model is clean and simple.

Shield developers from the messy HTML / JavaScript / CSS details

Enterprise Java developers have long embraced ORM solutions, which automatically generate relational database access code from the data model component in the application. JSF is the "ORM solution for the web layer". It automatically generates HTML / JavaScript / CSS code from well formed UI components.

A JSF application primarily contains two types of components -- both are easy to use and conforming to the POJO philosophy.

  • A JSF page is composed of XML tags. Each tag element corresponds to a UI component in JSF. As a web developer, you do not need to deal with the HTML markup or JavaScript details, as they are all generated from the JSF component tags. Since each UI component is self-contained and has well-defined behavior (i.e., it understand how to render itself and how to handle its data), JSF provides a very POJO-like experience for developing web UI.

  • Dynamic data on JSF pages and forms are modeled in POJOs known as JSF backing beans. The backing bean lifecycle is managed by the JSF server. For instance, a backing bean can have a session scope to track a user session. A backing bean can be dependency injected into another bean via an XML configuration file, and it can be injected into a JSF UI component via the JSF Expression Language (EL). The backing bean also provides the integration points between the web UI and the EJB3 business components.

The componentized UI and POJO data model make it easy to support JSF in IDE tools. In fact, many Java IDEs now support drag-and-drop UI designers for JSF. The JSF component model also allows third party vendors to develop and sell reusable UI component libraries. Those component libraries make it easy for server-side developers to take advantage of the latest browser technology without the need to mess with JavaScripts and such.

The JSF request model is powerful and easy to extend. Technologies like Facelets and Seam have been developed on top of JSF, providing even richer development environments. While competing frameworks all have nice features, JSF seems to be the easiest to extend. We expect even more innovative extensions in the near future, clearly making JSF the framework of choice for most EE projects.

Of course, JSF isn't without its drawbacks. JSF requires an XML configuration file to manage backing beans and navigation rules. As we will also soon see, the integration between JSF backing beans and EJB3 beans is not entirely smooth. In addition, JSF usage from JSPs can get tricky at times. However, these problems are not entirely unique to JSF. Other frameworks exhibit similar problems. The good news is that the JSF model is advanced enough that solutions to all of the issues have been developed.


JSF Home | All JSF Tutorials | Latest JSF Tutorials

Sponsored Links

If this tutorial doesn't answer your question, or you have a specific question, just ask an expert here. Post your question to get a direct answer.



Bookmark and Share

Comments(5)


1. View Comment

I am an MCA student i wanna know whether one can send an sms through java web application running in an web server like apache tomcat dynamically

View Tutorial          By: RAJU.K at 2009-07-24 02:28:21
2. View Comment

Yes, its possible to send SMS through web application. For that you need mobile software gateway(mobile server) to receive inputs from your web server. Mobile server gateway should be registered for receiving your web servers requests & data.
e.g. SMS from job sites to ur phone.


View Tutorial          By: Vidya at 2010-07-08 07:19:58
3. View Comment

could u help me i want to integrate the paypal system in my website

View Tutorial          By: Anand at 2011-01-17 21:59:25
4. View Comment

Aoa. could anybody guide me about jsf with hibernation. i wana make a shoping webapp .
(tutorial , lectures, videos, etc)


View Tutorial          By: imtiaz afridi at 2011-12-03 12:19:04
5. View Comment

can u plz send me jsf material in my gmail.

View Tutorial          By: rajesh at 2013-06-09 11:40:11

Your name (required):


Your email(required, will not be shown to the public):


Your sites URL (optional):


Your comments:



More Tutorials by Baski
Compiling multiple source files and specifying classpath using javac
The equals() Method example in Java
Default Values for Data Types in Java
JSP Example to connect to MS SQL database using Tomcat Connection Pool
<convertNumber> and <convertDateTime> in JSF
Enable/Disable Scripting Elements in JSP
Using calloc() Function in C
lseek() sample program in C
Arrays of Structures example program in C
The Basic Syntax Expression Language in JSP
Initialization of Pointer Arrays in C
Functions returning non-integer values in C
Increment and Decrement Operators in C
Getting Started with C
What is JSF (JavaServer Faces)?

More Tutorials in JSF
Struts Vs JSF (A comparison of Struts against JSF)
faces-config.xml to DirectTraffic in the JSF Application
<convertNumber> and <convertDateTime> in JSF
Action listeners in JSF
Calling Multiple Listeners in JSF
Using Javascript in JSF
How to open a new browser window from my JSF page?
Servlet error : java.lang.IndexOutOfBoundsException (JSF RI 1.1_01: IndexOutOfBoundsException)
JSF - TreeNode.setID gets IllegalArgument Exception
Install and Deploy JBoss Application Server
What is JSF (JavaServer Faces)?
Differences between JavaServer Faces technology and Struts
JSF Basics
The Relationship Between JSF and Other Java EE Technologies
JSF Life Cycle

More Latest News
Most Viewed Articles (in JSF )
How to open a new browser window from my JSF page?
Using Javascript in JSF
JSF Life Cycle
Java Bean Scopes in JSF
Calling Multiple Listeners in JSF
Struts Vs JSF (A comparison of Struts against JSF)
What is JSF (JavaServer Faces)?
Action listeners in JSF
faces-config.xml to DirectTraffic in the JSF Application
Servlet error : java.lang.IndexOutOfBoundsException (JSF RI 1.1_01: IndexOutOfBoundsException)
<convertNumber> and <convertDateTime> in JSF
The Relationship Between JSF and Other Java EE Technologies
Controlling Page Navigation in JSF - Static and Dynamic Navigation
Install and Deploy JBoss Application Server
JSF Basics
Most Emailed Articles (in JSF)
Controlling Page Navigation in JSF - Static and Dynamic Navigation
JSF Basics
JSF Life Cycle
Accessing Context Data in Beans using JSF
JSF - TreeNode.setID gets IllegalArgument Exception
Action listeners in JSF
Struts Vs JSF (A comparison of Struts against JSF)
What is JSF (JavaServer Faces)?
The Relationship Between JSF and Other Java EE Technologies
Installing JSF
Using Javascript in JSF
How to open a new browser window from my JSF page?
Servlet error : java.lang.IndexOutOfBoundsException (JSF RI 1.1_01: IndexOutOfBoundsException)
<convertNumber> and <convertDateTime> in JSF
Calling Multiple Listeners in JSF