Table of Contents
Preface xvAcknowledgments xixChapter 1: Getting Started 2
Why JavaServer Faces? 3
Software Installation 4
A Simple Example 6
Sample Application Analysis 12
Development Environments for JSF 21
JSF Framework Services 28
Behind the Scenes 30
Chapter 2: Managed Beans 36
Definition of a Bean 37
Message Bundles 42
A Sample Application 46
Backing Beans 53
Bean Scopes 54
Configuring Beans 57
The Syntax of Value Expressions 64
Chapter 3: Navigation 70
Static Navigation 71
Dynamic Navigation 73
Advanced Navigation Issues 84
Chapter 4: Standard JSF Tags 90
An Overview of the JSF Core Tags 92
An Overview of the JSF HTML Tags 94
Forms 103
Text Fields and Text Areas 108
Buttons and Links 119
Selection Tags 130
Messages 157
Panels 163
Chapter 5: Data Tables 170
The Data Table Tag—h:dataTable 171
A Simple Table 173
Headers, Footers, and Captions 178
JSF Components 182
Editing Table Cells 186
Styles 189
Database Tables 191
Table Models 197
Scrolling Techniques 214
Chapter 6: Conversion and Validation 218
Overview of the Conversion and Validation Process 219
Using Standard Converters 221
Using Standard Validators 233
Programming with Custom Converters and Validators 240
Chapter 7: Event Handling 266
Life Cycle Events 268
Value Change Events 269
Action Events 275
Event Listener Tags 285
Immediate Components 287
Passing Data from the UI to the Server 291
Phase Events 295
Putting It All Together 303
Chapter 8: Subviews and Tiles 314
Common Layouts 315
A Book Viewer and a Library 316
The Book Viewer 318
Content Inclusion in the Book Viewer 328
The Library 339
Chapter 9: Custom Components, Converters, and Validators 354
Classes for Implementing Custom Components 356
Encoding: Generating Markup 362
Decoding: Processing Request Values 366
Implementing Custom Component Tags 372
Revisiting the Spinner 387
Encoding JavaScript to Avoid Server Roundtrips 404
Using Child Components and Facets 408
Implementing Custom Converters and Validators 432
Chapter 10: External Services 450
Database Access with JDBC 451
Configuring a Data Source 457
An Introduction to LDAP 473
Managing Configuration Information 483
Container-Managed Authentication and Authorization 505
Using Web Services 516
Chapter 11: Ajax 528
Ajax Fundamentals 530
JavaScript Libraries 533
Form Completion 534
Realtime Validation 537
Propagating Client-Side View State 542
Direct Web Remoting 543
Ajax Components 546
Ajax4jsf 554
Chapter 12: Open Source 570
Web Flow—Shale 572
Alternate View Technologies—Facelets 585
EJB Integration—Seam 596
Chapter 13: How Do I . . . 610
Web User Interface Design 611
Validation 658
Programming 669
Debugging and Logging 684
Index 699