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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Contents<br />

Component, Renderer, and Tag Combinations ..................................................................... 410<br />

Understanding the Image Map Example ........................................................................................ 411<br />

Why Use <strong>Java</strong>Server Faces Technology to Implement an Image Map? ............................... 411<br />

Understanding the Rendered HTML ...................................................................................... 411<br />

Understanding the JSP Page ..................................................................................................... 412<br />

Configuring Model Data ........................................................................................................... 414<br />

Summary of the Application Classes ....................................................................................... 415<br />

Steps for Creating a Custom Component ....................................................................................... 416<br />

Creating Custom Component Classes ............................................................................................ 417<br />

Specifying the Component Family .......................................................................................... 419<br />

Performing Encoding ................................................................................................................ 420<br />

Performing Decoding ................................................................................................................ 422<br />

Enabling Component Properties to Accept Expressions ...................................................... 422<br />

Saving and Restoring State ........................................................................................................ 424<br />

Delegating Rendering to a Renderer ............................................................................................... 425<br />

Creating the Renderer Class ..................................................................................................... 425<br />

Identifying the Renderer Type ................................................................................................. 427<br />

Handling Events for Custom Components .................................................................................... 427<br />

Creating the Component Tag Handler ........................................................................................... 428<br />

Retrieving the Component Type .............................................................................................. 429<br />

Setting Component Property Values ....................................................................................... 429<br />

Providing the Renderer Type ................................................................................................... 431<br />

Releasing Resources ................................................................................................................... 432<br />

Defining the Custom Component Tag in a Tag Library Descriptor ........................................... 432<br />

14 Configuring <strong>Java</strong>Server Faces Applications ..................................................................................435<br />

Application Configuration Resource File ....................................................................................... 435<br />

Configuring Beans ............................................................................................................................. 436<br />

Using the managed-bean Element ............................................................................................ 437<br />

Initializing Properties Using the managed-property Element ............................................ 439<br />

Initializing Maps and Lists ........................................................................................................ 444<br />

Registering Custom Error Messages ............................................................................................... 445<br />

Registering Custom Localized Static Text ...................................................................................... 446<br />

Registering a Custom Validator ....................................................................................................... 447<br />

Registering a Custom Converter ..................................................................................................... 448<br />

13

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

Saved successfully!

Ooh no, something went wrong!