Rough Cuts are manuscripts that are developed but not yet published, available through Safari. Rough Cuts provide you access to the very latest information on a given topic and offer you the opportunity to interact with the author to influence the final publication.
This is the Rough Cut version of the printed book.
JavaServer Faces (JSF) is the standard Java EE technology for building web user interfaces. It provides a powerful framework for developing server-side applications, allowing you to cleanly separate visual presentation and application logic. JSF 2.0 is a major upgrade, which not only adds many useful features but also greatly simplifies the programming model by using annotations and “convention over configuration” for common tasks.
To help you quickly tap into the power of JSF 2.0, the third edition of Core JavaServer™ Faces has been completely updated to make optimum use of all the new features. The book includes
Core JavaServer™ Faces, Third Edition, provides everything you need to master the powerful and time-saving features of JSF 2.0 and is the perfect guide for programmers developing Java EE 6 web apps on Glassfish or another Java EE 6-compliant application servers, as well as servlet runners such as Tomcat 6.
Preface xv
Acknowledgments xix
Chapter 1: Getting Started 2
Why JavaServer Faces? 3
A Simple Example 4
Development Environments for JSF 13
An Analysis of the Sample Application 15
A First Glimpse of Ajax [JSF 2.0 Topic] 21
JSF Framework Services 24
Behind the Scenes 26
Conclusion 31
Chapter 2: Managed Beans 32
Definition of a Bean 33
CDI Beans [CDI Topic] 39
Message Bundles 40
A Sample Application 45
Bean Scopes 51
Configuring Beans 56
The Expression Language Syntax 63
Conclusion 71
Chapter 3: Navigation 72
Static Navigation 73
Dynamic Navigation 74
Redirection 86
RESTful Navigation and Bookmarkable URLs [JSF 2.0 Topic] 88
Advanced Navigation Rules 96
Conclusion 99
Chapter 4: Standard JSF Tags100
An Overview of the JSF Core Tags 102
An Overview of the JSF HTML Tags 105
Panels 115
The Head, Body, and Form Tags 118
Text Fields and Text Areas 123
Buttons and Links 134
Selection Tags 145
Messages 171
Conclusion 177
Chapter 5: Facelets [JSF 2.0 Topic] 178
Facelets Tags 179
Templating with Facelets 181
Custom Tags 195
Loose Ends 198
Conclusion 202
Chapter 6: Data Tables 204
The Data Table Tag–h:dataTable 205
A Simple Table 207
Headers, Footers, and Captions 212
Styles 215
JSF Components in Tables 218
Editing Tables 2
Database Tables 228
Table Models
Scrolling Techniques 242
Conclusion 244
Chapter 7: Conversion and Validation 246
Overview of the Conversion and Validation Process 247
Using Standard Converters 249
Using Standard Validators 262
Bean Validation [JSF 2.0 Topic] 270
Programming with Custom Converters and Validators 275
Implementing Custom Converter and Validator Tags 297
Conclusion 303
Chapter 8: Event Handling 304
Events and the JSF Life Cycle 306
Value Change Events 307
Action Events 312
Event Listener Tags 318
Imm
