7.6 Looking Ahead to JavaServer Faces

JavaServer Faces (JSF) is designed to provide a standard set of JSP tags and Java classes that will make it easier to build Java server application GUIs. One of the problems that JSF is trying to address is that the Servlet and JSP technologies don't provide specific enough APIs for creating the client GUI, and developers have to rely on HTML components and one of several alternatives to facilitate style and behavioral changes to all of the views. The mechanism to manage all of this eventually takes on a life of its own and overshadows the business of the application. Instead of performing maintenance on business operations and logic, more and more time is needed to manage the presentation controls.

JSF plans to fix this by creating a standard way to define complex HTML forms and other GUI elements. This will enable developers to focus their attention on a single component framework.

The first release of the framework includes the following design goals:

1.       Create a standard GUI component framework, which can be leveraged by development tools to make it easier for tool users to both create high-quality GUIs and manage the GUIs' connections to application behavior.

2.       Define a set of simple, lightweight Java base classes for GUI components, component state, and input events. These classes will address GUI lifecycle issues, notably managing a component's persistent state for the lifetime of its page.

3.       Provide a set of common GUI components, including the standard HTML form input elements. These components will be derived from the simple set of base classes (outlined in #2) that can be used to define new components.

4.       Provide a JavaBeans model for dispatching events from client-side GUI controls to server-side application behavior.

5.       Define APIs for input validation, including support for client-side validation.

6.       Specify a model for internationalization and localization of the GUI.

7.       Automate the generation of appropriate output for the target client, taking into account all available client configuration data (browser version, etc.).

8.       Automate the generation of output containing required hooks for supporting accessibility.

7.6.1 What Does JSF Have to Do with Struts?

JSF and Struts will fit together quite well, and developers eventually will be able to supplement or substitute the Struts custom tag libraries with JSF components. The rest of the Struts framework (both model and controller components) will remain relatively unaffected by the JSF architecture.

JSF also will include an event model, but the architecture will be designed so that developers can choose to use the GUI components with or without the event mechanism.

Because there currently is no public specification for JSF, it's hard to be specific on exactly how the two will tie into each other. However, Craig McClanahan, the founder of the Struts framework, is now also the specification lead for the JavaServer Faces JSR. We can look closely at Craig's comments on JSF and Struts and know that he is speaking with subject-matter expertise.

You can find the JavaServer Faces JSR at http://jcp.org/jsr/detail/127.jsp.