JSF | Java Server Faces
JSF technology includes a set of APIs, which represent different UI components and helps in managing their states. These APIs further help in handling events on the UI components and validate user inputs through the UI components. JSF framework provides the flexibility of creating simple as well as complex applications as this technology uses the most popular Java server technologies (Servlet and Java Server Page) and does not limit a developer to a specific markup language or client device. The UI component classes bundled with JSF APIs contain logic implementation for various component functionalities and do not have any client-specific presentation logic therefore, the JSF UI components can be rendered for different client devices. Currently, SF provides a custom renderer and Java Server Page(JSP) custom tag for rendering UI components for an HTML client.
JSF is robust Web application framework that implements an event programming model to handle different events and actions performed by the client on different UI components. To handle each event, a listener should be registered on server side. While developing a Web application, a developer has to write navigation rules inside the source code to navigate from one Web page to another. JSF provides a simple way to define navigation rules in a configuration file and display different error messages showing the real cause of errors to clients. These messages are generated while validating user inputs against some validation rule and can be displayed on the same page that contains the UI components.
There are different Web application frameworks that implement one or more of MVC design pattern. JSF is based on MVC2 pattern and this pattern is based on component type development. In this pattern, the developers have to concentrate only on their respective component introduces separate layers, such as model view and controller and helps the developer to concentrate on a single type of component by making a Web application easy to maintain. The different categories of components, such as model view, and controller are created for different functionalities, such as use of Text Field, Dialog Box Simple Label and Color Chooser and can be used separately
Explaining the Features of JSF
Java technology provides various frameworks to develop a Web application Some of these frameworks, such as Struts, are more popular than JSF, but the rich yet simple features of JSF make it one of the preferred choices for designing and managing UI components in a Web application.
The following are the various features of JSF:
- Provides an easy to use environment that is integrated Development Environment (IDE) for developing Web applications with JSF UI components. It has extensive tool support from the companies, such as Sun, IBM, and Oracle.
- Facilitates creating complex UI components in a Web page through its own set of tags which are provided as JSP custom tag library. Designing a UI component is easy with JSF as it is based on MVC design pattern, which clearly separates presentation and business logic.
- Provides a way to manage all UI components in a Web page. Managing UI components indudes validation of user input, state of component, page navigation and event handling.
- Provides extensible architecture, which means that you can add other functionalities over JSF and can easily customize and reuse JSF UI components.
- Supports multiple client devices. There are different renderers to make similar UI components to be rendered or displayed for different client devices. Various component classes can be extended to create custom component tag libraries to support a particular type of client.
- Contains components that support internationalization and enable displaying localized messages according to the specified Locale.
- Supports a standard Rapid Application Development (RAD) Java Web application framework which enables fast development of a powerful application with a set of reusable components
- Provides the developer with a way to link visual components to the controller or model components without breaking the layer.
- Provides Expression Language (EL) for a JSF page. As JSF pages use JSP tags, it is difficult to embed separate ELs into one JSF page. One of the key concerns of Java EE specification is to keep its different Web tier technologies, such as ISP, JSF, and JSP Standard Tag Library(JSTL) aligned. This alignment resulted in the creation of a Unified EL, which integrates JSP 2.0 EL and JSF 1.1 EL. JSP 2.1 and JSF 1.2 support this Unified EL. In other words, you can use the JSTL tags with JSF components.
- Allows the configuration of application wide ResourceBundle to EL using <resource-bundle> element in the faces-config.xml file.