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:
7.6.1 What Does JSF Have to Do with Struts?JSF and Struts should 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.
Because there currently is no final 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 one of the specification leads for the JSF JSR. We can look closely at Craig's comments on JSF and Struts and know that he is speaking with subject-matter expertise. In fact, Struts 1.1 ships with an early look at how the two might fit together. If you look in the contrib folder under the Struts binary installation, you will find a directory named struts-faces. This directory contains a library which supports the use of JSF in a Struts-based application. There are also a couple examples that you can actually run in a container and see JSF work first hand. For more information on this library and JSF in general, see Chapter 18. You can find the JSF JSR online at http://jcp.org/jsr/detail/127.jsp. |