10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

11<br />

CHAPTER 11<br />

Using <strong>Java</strong>Server FacesTechnology in JSP Pages<br />

<strong>The</strong> page author’s responsibility is to design the pages of a <strong>Java</strong>Server Faces application. This<br />

includes laying out the components on the page and wiring them to backing beans, validators,<br />

converters, and other server-side objects associated with the page. This chapter uses the Duke’s<br />

Bookstore application and the Coffee Break application (see Chapter 36, “<strong>The</strong> Coffee Break<br />

Application”) to describe how page authors use the <strong>Java</strong>Server Faces tags to perform the<br />

following tasks:<br />

■ Lay out standard UI components on a page<br />

■ Reference localized messages<br />

■ Register converters, validators, and listeners on components<br />

■ Bind components and their values to server-side objects<br />

■ Reference backing bean methods that perform navigation processing, handle events, and<br />

perform validation<br />

This chapter also describes how to include custom objects created by application developers<br />

and component writers on a JSP page.<br />

<strong>The</strong> Example <strong>Java</strong>Server Faces Application<br />

<strong>The</strong> <strong>Java</strong>Server Faces technology chapters of this tutorial primarily use a rewritten version of the<br />

Duke’s Bookstore example to illustrate the basic concepts of <strong>Java</strong>Server Faces technology. This<br />

version of the Duke’s Bookstore example includes several <strong>Java</strong>Server Faces technology features:<br />

■ <strong>The</strong> <strong>Java</strong>Server Faces implementation provides FacesServlet, whose instances accept<br />

incoming requests and pass them to the implementation for processing. <strong>The</strong>refore, the<br />

application does not need to include a servlet (such as the Dispatcher servlet) that processes<br />

request parameters and dispatches to application logic, as do the other versions of Duke’s<br />

Bookstore.<br />

■ A custom image map component that allows you to select the locale for the application.<br />

317

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!