background image

JavaServer Faces Technology Benefits

<< JavaServer Faces Technology | What Is a JavaServer Faces Application >>
<< JavaServer Faces Technology | What Is a JavaServer Faces Application >>

JavaServer Faces Technology Benefits

The JSP page, myform.jsp, is a JavaServer Faces page, which is a JSP page that includes
JavaServer Faces tags. It expresses the user interface components by using custom tags defined
by JavaServer Faces technology. The UI for the web application (represented by myUI in the
figure) manages the objects referenced by the JSP page. These objects include
The UI component objects that map to the tags on the JSP page
Any event listeners, validators, and converters that are registered on the components
The JavaBeans components that encapsulate the data and application-specific functionality
of the components
This chapter gives an overview of JavaServer Faces technology. After going over some of the
primary benefits of using JavaServer Faces technology and explaining what a JavaServer Faces
application is, it describes a simple application and specifies which part of the application the
developers of each role work on. It then describes the UI component model, the navigation
model, and the backing bean features supported by JavaServer Faces technology. Finally, this
chapter uses a page from a simple application to summarize the life cycle of a JavaServer Faces
page.
JavaServer Faces Technology Benefits
One of the greatest advantages of JavaServer Faces technology is that it offers a clean separation
between behavior and presentation. Web applications built using JSP technology achieve this
separation in part. However, a JSP application cannot map HTTP requests to
component-specific event handling nor manage UI elements as stateful objects on the server, as
a JavaServer Faces application can. JavaServer Faces technology allows you to build web
applications that implement the finer-grained separation of behavior and presentation that is
traditionally offered by client-side UI architectures.
The separation of logic from presentation also allows each member of a web application
development team to focus on his or her piece of the development process, and it provides a
simple programming model to link the pieces. For example, page authors with no programming
expertise can use JavaServer Faces technology UI component tags to link to server-side objects
from within a web page without writing any scripts.
Browser
Web Container
myform.jsp
myUI
Access page
HTTP Request
Renders HTML
HTTP Response
FIGURE 10­1
The UI Runs on the Server
JavaServer Faces Technology Benefits
The Java EE 5 Tutorial · September 2007
286