Document Information

Preface

Part I Introduction

1.  Overview

2.  Using the Tutorial Examples

Part II The Web Tier

3.  Getting Started with Web Applications

4.  Java Servlet Technology

5.  JavaServer Pages Technology

6.  JavaServer Pages Documents

7.  JavaServer Pages Standard Tag Library

8.  Custom Tags in JSP Pages

9.  Scripting in JSP Pages

10.  JavaServer Faces Technology

The Example JavaServer Faces Application

Setting Up a Page

Using the Core Tags

Adding UI Components to a Page Using the HTML Component Tags

UI Component Tag Attributes

The id Attribute

The immediate Attribute

The rendered Attribute

The style and styleClass Attributes

The value and binding Attributes

Adding a Form Component

Using Text Components

Rendering a Text Field with the inputText Tag

Rendering a Label with the outputLabel Tag

Rendering a Hyperlink with the outputLink Tag

Displaying a Formatted Message with the outputFormat Tag

Rendering a Password Field with the inputSecret Tag

Using Command Components for Performing Actions and Navigation

Rendering a Button with the commandButton Tag

Rendering a Hyperlink with the commandLink Tag

Using Data-Bound Table Components

Adding Graphics and Images with the graphicImage Tag

Laying Out Components with the UIPanel Component

Rendering Components for Selecting One Value

Displaying a Check Box Using the selectBooleanCheckbox Tag

Displaying a Menu Using the selectOneMenu Tag

Rendering Components for Selecting Multiple Values

The UISelectItem, UISelectItems, and UISelectItemGroup Components

Using the selectItems Tag

Using the selectItem Tag

Displaying Error Messages with the message and messages Tags

Using Localized Data

Loading a Resource Bundle

Referencing Localized Static Data

Referencing Error Messages

Using the Standard Converters

Converting a Component's Value

Using DateTimeConverter

Using NumberConverter

Registering Listeners on Components

Registering a Value-Change Listener on a Component

Registering an Action Listener on a Component

Using the Standard Validators

Validating a Component's Value

Using the LongRangeValidator

Binding Component Values and Instances to External Data Sources

Binding a Component Value to a Property

Binding a Component Value to an Implicit Object

Binding a Component Instance to a Bean Property

Binding Converters, Listeners, and Validators to Backing Bean Properties

Referencing a Backing Bean Method

Referencing a Method That Performs Navigation

Referencing a Method That Handles an Action Event

Referencing a Method That Performs Validation

Referencing a Method That Handles a Value-change Event

Using Custom Objects

Using a Custom Converter

Using a Custom Validator

Using a Custom Component

12.  Developing with JavaServer Faces Technology

13.  Creating Custom UI Components

14.  Configuring JavaServer Faces Applications

15.  Internationalizing and Localizing Web Applications

Part III Web Services

16.  Building Web Services with JAX-WS

17.  Binding between XML Schema and Java Classes

18.  Streaming API for XML

19.  SOAP with Attachments API for Java

Part IV Enterprise Beans

20.  Enterprise Beans

21.  Getting Started with Enterprise Beans

22.  Session Bean Examples

23.  A Message-Driven Bean Example

Part V Persistence

24.  Introduction to the Java Persistence API

25.  Persistence in the Web Tier

26.  Persistence in the EJB Tier

27.  The Java Persistence Query Language

Part VI Services

28.  Introduction to Security in the Java EE Platform

29.  Securing Java EE Applications

30.  Securing Web Applications

31.  The Java Message Service API

32.  Java EE Examples Using the JMS API

33.  Transactions

34.  Resource Connections

35.  Connector Architecture

Part VII Case Studies

36.  The Coffee Break Application

37.  The Duke's Bank Application

Part VIII Appendixes

A.  Java Encoding Schemes

B.  About the Authors

Index

 

Chapter 11

Using JavaServer Faces Technology in JSP Pages

The page author’s responsibility is to design the pages of a JavaServer Faces application. This includes laying out the components on the page and wiring them to backing beans, validators, converters, and other server-side objects associated with the page. This chapter uses the Duke’s Bookstore application and the Coffee Break application (see Chapter 36, The Coffee Break Application) to describe how page authors use the JavaServer Faces tags to perform the following tasks:

  • Lay out standard UI components on a page

  • Reference localized messages

  • Register converters, validators, and listeners on components

  • Bind components and their values to server-side objects

  • Reference backing bean methods that perform navigation processing, handle events, and perform validation

This chapter also describes how to include custom objects created by application developers and component writers on a JSP page.