Ideal for the 3+ million Java developers, this fast-paced tutorial offers in-depth coverage of JavaServer Faces (JSF) -- Sun Microsystem's Web application architecture for the future. Co-written by the #1 JSF expert in the Java community, this book offers the most complete resource on JSF available. * Extensive coverage on JSF custom component development * Serves as a thorough introduction to AJAX technology and techniques * Numerous custom JSF component examples including AJAX enabled components provided
Author(s): Chris Schalk, Ed Burns, James Holmes
Edition: 1
Publisher: McGraw-Hill Osborne Media
Year: 2006
Language: English
Pages: 865
Contents......Page 8
Foreword......Page 20
Acknowledgments......Page 22
Introduction......Page 24
Part I: The JavaServer Faces Framework......Page 26
What Is JavaServer Faces?......Page 28
The History of JavaServer Faces......Page 29
The JavaServer Faces Design Goals......Page 32
JSF—A Framework for Both “Corporate” Developers and “Systems” Developers......Page 34
JSF Application Architecture......Page 35
Application Overview......Page 40
Setting Up Your JSF Development Environment......Page 55
Compiling, Packaging, and Running the Application......Page 57
Reviewing the Key Portions of the Application......Page 59
A High-Level Overview of the JSF Request Processing Lifecycle......Page 60
Observing the Request Processing Lifecycle in Action......Page 70
Advanced Topics Related to the Request Processing Lifecycle......Page 73
Lifecycle Concepts to Remember......Page 76
What Are Managed Beans?......Page 78
Controlling Managed Bean Life Spans......Page 88
The JSF Expression Language......Page 90
Web Application Development Details on Managed Beans......Page 97
5 The Navigation Model......Page 104
Overview of the Navigation Model......Page 105
Building Navigation Rules......Page 108
More Sophisticated Navigation Examples......Page 114
What Are UI Components?......Page 118
Introducing the JSF UI Component Architecture......Page 124
UI Components and JSP......Page 130
7 Converting and Validating Data......Page 136
Some Validation and Conversion Examples......Page 137
Conversion and Validation Under the Covers......Page 139
The Faces Converter System......Page 142
The Faces Validation System......Page 155
Tie It All Together: Messages in a View......Page 162
A High-Level Overview of the JSF Event Model......Page 170
How JSF Events Work......Page 171
Writing Custom Action and Value Change Listeners......Page 178
Two Faces Event Examples......Page 181
Working with Phase Events and Listeners......Page 188
Creating Custom Events and Listeners......Page 191
Part II: Extending JavaServer Faces......Page 192
A Quick Tour of the Virtual Trainer Application......Page 194
The Virtual Trainer Application Architecture......Page 200
Building the Virtual Trainer Application......Page 204
Implementing Sortable Columns......Page 234
Taking the Next Step—Persisting Virtual Trainer Data......Page 241
Internationalizing the Virtual Trainer Application......Page 250
10 Building Custom UI Components......Page 254
The Moving Parts of a UI Component......Page 255
A Simple Hello World Example......Page 257
A JSF Stock Quote Component......Page 267
An InputDate Component with Multiple Renderers......Page 269
Dynamically Changing the Renderer at Runtime......Page 281
A Custom Chart Component......Page 283
Using JavaScript in a Custom JSF Component—A Slider Example......Page 289
Advanced Custom JSF Component Development......Page 295
Packaging JSF Components into a Self-Contained JAR......Page 303
A JSF Components Package Example: components.jar......Page 305
The Future of JSF Component Metadata......Page 310
Introduction to AJAX......Page 312
AJAX Under the Hood......Page 313
DirectorySearch—A First AJAX Example Without JSF......Page 317
Building AJAX-Enabled JSF Components......Page 322
AJAX Tips and Tricks......Page 343
AJAX XMLHttpRequest Reference......Page 344
Non-UI Custom Components and Decoration in JSF......Page 346
Non-View Custom Components Explained......Page 349
Motivation for Alternate View Description Technology......Page 384
The Relationship of the ViewHandler to the Rest of the JSF System......Page 385
How to Build and Install a Custom ViewHandler......Page 387
The Facelets View Description Technology......Page 393
The Design, Architecture, and Implementation of Facelets......Page 405
Part III: Applying JavaServer Faces......Page 410
Localization......Page 412
Accessibility......Page 424
Aspects and Implementation of Web Application Security......Page 428
Container-Managed Security......Page 429
Application-Managed Security with JavaServer Faces......Page 440
Implementing a “Remember Me” Feature......Page 447
Leveraging JAAS from a JSF Application......Page 461
To Learn More about Security......Page 469
16 Automated Testing and Debugging of JavaServer Faces Applications......Page 470
A Review of Software Testing Terminology......Page 471
Tools for the Automated Testing of Web Applications......Page 474
Debugging JSF Applications......Page 492
Source-Level Debugging with Eclipse......Page 498
Source-Level Debugging with NetBeans......Page 500
JSF JSP Debugging with Oracle JDeveloper......Page 503
Part IV: JavaServer Faces Tools and Libraries......Page 506
17 Developing JSF Applications with Visual Development Environments......Page 508
The Application......Page 509
Sun Java Studio Creator......Page 510
BEA Workshop Studio......Page 517
Oracle JDeveloper 10g......Page 522
IBM Rational Web Developer......Page 538
Exadel Studio Pro......Page 546
18 The JavaServer Faces Configuration File......Page 556
Understanding XML DTDs......Page 557
Understanding How Configuration Files Are Processed......Page 558
The Faces Configuration Elements......Page 559
Extension Elements......Page 633
Metadata Elements......Page 634
Editing Configuration Files with Faces Console......Page 636
A Brief Review of JSF and JSP Tag Nomenclature......Page 638
The Core and HTML Component Library Reference......Page 639
The Standard HTML Library......Page 658
20 The MyFaces Implementation and Component Library......Page 708
Acquiring MyFaces......Page 709
Using MyFaces......Page 710
The MyFaces Extended Components......Page 712
The MyFaces Custom Components......Page 727
The MyFaces Custom Validators......Page 774
The MyFaces Support for the Tiles Framework......Page 779
Part V: Appendixes......Page 788
A: Faces Console Quick Reference......Page 790
Supported Configuration Files......Page 791
Using Faces Console as a Stand-Alone Application......Page 792
Using Faces Console Inside Borland JBuilder......Page 793
Using Faces Console Inside Eclipse......Page 795
Using Faces Console Inside IBM Rational Application Developer for WebSphere......Page 798
Using Faces Console Inside IntelliJ IDEA......Page 800
Using Faces Console Inside NetBeans and Sun ONE Studio (Forte)......Page 802
Using Faces Console Inside Oracle JDeveloper......Page 804
Configuring the Faces Console Output Options......Page 806
Sun’s Extended UI Component Library......Page 808
Oracle’s ADF Faces......Page 809
ADF Faces Key Technologies......Page 815
JSFCentral—A Reference for Third-Party Components......Page 829
Similarities and Differences......Page 830
Development Style......Page 832
Migration Strategy: The Struts-Faces Integration Library......Page 833
Shale, the Java Community Process, and Innovation......Page 838
Getting and Running Shale......Page 840
A Guide to Shale Features......Page 843
Conclusion and Resources......Page 859
C......Page 860
F......Page 861
M......Page 862
R......Page 863
T......Page 864
X......Page 865