263
Chapter 6
Component-Based Web
Development Using JSF 2
It’s so beautifully arranged on the plate—you just know someone’s fingers have been
all over it.
—Julia Child
JavaServer Faces (JSF) is a component-based framework for developing web applications. The
distinctive feature that sets component-based frameworks apart is the ability to create and distribute
reusable UI components. In general, a component represents an abstraction, a well-defined contract
with the implementation details hidden from the user of the component. That is, the user of the
component does not need to know the internal mechanisms of the component in order to be able
to use it. Struts and Spring Web MVC alleviate the increasing complexities of building sophisticated
user interfaces for the Web, but these web frameworks are not component-centric and therefore
unqualified for engineering truly reusable UI components. To that end, different web frameworks,
such as Tapestry and Wicket, emerged to offer a component-centric approach to web application
development. However, because of a lack of existing standards for component-centric development,
the ways in which these web frameworks implemented reusable UI components appeared to an
experienced web developer to be tedious or limited.
JSF standardizes component-based web development and provides numerous and broad-ranging UI
components to reduce the complexities in web application development. JSF provides out-of-the-box
reusable UI components so that the application developers can concentrate on the application’s
business logic rather than striving to develop and maintain dynamic and rich user interfaces. JSF is
the evolution of a few frameworks such as Struts and was inspired by Swing’s component model.
JSF represents, and requires, a paradigm shift to let you think in terms of components instead of
requests and responses. Its goal is to make web development rapid by promoting and standardizing
an ecosystem to engineer reusable UI components.