Thursday 26 July 2012

Introduction
JavaServerFaces(JSF) can be defined as a framework, which makes web application development easy by providing rich, powerful and ready to use user Interface(UI) components. The JSF Framework is based on the model-view-Controller(MVC) design pattern, which is one of the most popular design patterns available.

JSF not only provides simple tags to design UI components(Such as labels, text boxes, list boxes, data grids, and so on), it also enables

Binding UI Component with some model data

Handling different events on UI components(Such as text changes in a text box) at the server side.

Validating user inputs and conveying all validation error message to the client.

Defining Navigation rules from one view to anther according to the output of the business process, and so on.

*JSF is a product of java community Process(JCP), which provides proposals for new java application programming interface(APIs) and technology enhancements in the form of java specification requests(JSR) 

JSF Architecture
We can create view component with the presentation logic, and some model component providing business logic implementation.
A Controller is again a different component, which controls the execution of various model methods and manages the navigation from one view to anther in a web application
In JSF, we have a single Front Controller, which handles all JSF request mapped to it.
The Controller part of the JSF architecture consists of Font Controller Servlet, i.e FacesServlet, the centralized configuration file, faces-config.xml, and a set of event handlers for a web application.
The Front controller Servlet receives all the request and manages the request processing life cycle of each request to generate response for the clients.
The FacesServlet Servlet manages the request processing life cycle of web applications that utilize java server faces to construct the user interface.

The web.xml file of every JSF application specifies a java servlet of the type FaceServlet.

In a JSF application, all request are channeled through FacesServlet. This Servlet  controls the flow between pages of application based on the outcome of the events of the UI Components.
The FacesServlet routes user request by referencing page-to-page mapping stored in the faces-config.xml configuration file. 




No comments:

Post a Comment