Show TOC

Background documentationJavaServer Faces Locate this document in the navigation structure

 

JavaServer Faces (JSF) is one of the most advanced Java technologies for the development of user interfaces. JSF can be used for creating any type of UI but is mainly aimed at Web programming. As its name suggests, this is a server-side technology, meaning that it is suitable for providing dynamically generated content. Since Java EE 5, JSF is an integral part of the Java EE specification.

For more information, see java.sun.com/javaee/javaserverfaces/.

Some of the key strengths of JSF are:

  • Standard-based

    Being a standard creates a non-proprietary environment for controlled development of the framework. On the one hand, such an environment guarantees to application developers that their applications can be executed on multiple JSF implementations. On the other hand, it creates the necessary conditions for adding future improvements to the framework.

  • Extendable

    JSF is designed to be highly extensible in various ways. Each JSF vendor has to supply a basic set of UI components but additional components can be easily developed in the cases when those components cannot satisfy the application requirements to the UI. Another example of JSF's extensibility is the possibility of using multiple render kits. UI components can have different representations, such as HTML, WML, SVG or XUL. Non-markup representation is just another option.

  • Customizable

    The JSF runtime is highly flexible. Runtime aspects such as lifecycle management, response generation mechanisms and state saving approaches can be easily tailored to the specifics of an application.

With regard to Web programming, the JSF technology integrates well with JSP, servlet, HTML, JavaScript and other technologies. Web pages are designed with JSF tags plugged into JSP pages.

JSF is especially useful if you want to enable dynamic page reloading or user input validation. Of course, you can provide these features even if you are using solely JSP, servlet or any other technology. The advantage of JSF, however, is that it has built-in support for such tasks, simplifying the development process of Web applications. JSF has a specific request processing lifecycle, an extendable UI component model, and strong event handling mechanism. These features allow the rapid application development (RAD) principles, which are typical to traditional UI development, to be applied for Java EE based applications.

JSF technology provides a perfect separation of components according to the Model, View and Controller (MVC) principle. Pure servlet and JSP technologies, for example, mix the HTML presentation (View) logic with the programming (Model and Controller) logic. This means that the person who designs the HTML layout of the application also has to be a programmer, or vice-versa. With JSF, the designer works with XML-like tags, most of which are equivalent to HTML tags and some of their attributes. The Java programmer writes the underlying Model and Controller logic in the form of JavaBeans. The programmer only provides a set of bean properties (variables in the source code), which the designer binds to in the designed pages.