JavaServer Faces (JSF) is quickly emerging as the leading solution for rapid user interface development in Java-based server-side applications. Now, Core JavaServer™ Faces–the #1 guide to JSF–has been thoroughly updated in this second edition, covering the latest feature enhancements, the powerful Ajax development techniques, and open source innovations that make JSF even more valuable.
Authors David Geary and Cay Horstmann delve into all facets of JSF 1.2 development, offering systematic best practices for building robust applications, minimizing handcoding, and maximizing productivity. Drawing on unsurpassed insider knowledge of the Java platform, they present solutions, hints, tips, and “how-tos” for writing superior JSF 1.2 production code, even if you’re new to JSF, JavaServer Pages™, or servlets.
The second edition’s extensive new coverage includes: JSF 1.2’s improved alignment with the broader Java EE 5 platform; enhancements to the JSF APIs; controlling Web flow with Shale; and using Facelets to replace JSP with XHTML markup. The authors also introduce Ajax development with JSF–from real-time validation and Direct Web Remoting to wrapping Ajax in JSF components and using the popular Ajax4jsf framework.
This book will help you
Automate low-level details and eliminate unnecessary complexity in server-side development
Discover JSF best practices, ranging from effective UI design and style sheets to internationalization
Use JSF with Tiles to build consistent, reusable user interfaces
Leverage external services such as databases, LDAP directories, authentication/authorization, and Web services
Use JBoss Seam to greatly simplify development of database-backed applications
Implement custom components, converters, and validators
Master the JSF 1.2 tag libararies, and extend JSF with additional tag libraries
Chapter 1: Getting Started
Chapter 2: Managed Beans
Chapter 3: Navigation
Chapter 4: Standard JSF Tags
Chapter 5: Data Tables
Chapter 6: Conversion and Validation
Chapter 7: Event Handling
Chapter 8: Subviews and Tiles
Chapter 9: Custom Components, Converters, and Validators
Chapter 10: External Services
Chapter 11: Ajax
Chapter 12: Open Source
Chapter 13: How Do I . . .
Table of Contents
1. Getting Started
- Why JavaServer Faces?
- Software Installation
- A Simple Example
- Sample Application Analysis
- Development Environments for JSF
- JSF Framework Services
- Behind the Scenes
2. Managed Beans
- Definition of a Bean
- Message Bundles
- A Sample Application
- Backing Beans
- Bean Scopes
- Configuring Beans
- The Syntax of Value Expressions
- 3. Navigation
4. Standard JSF Tags
- An Overview of the JSF Core Tags
- An Overview of the JSF HTML Tags
- Text Fields and Text Areas
- Buttons and Links
- Selection Tags
5. Data Tables
- The Data Table Tag—h:dataTable
- A Simple Table
- Headers, Footers, and Captions
- JSF Components
- Editing Table Cells
- Database Tables
- Table Models
- Scrolling Techniques
6. Conversion and Validation
- Overview of the Conversion and Validation Process
- Using Standard Converters
- Using Standard Validators
Programming with Custom Converters and Validators
- Implementing Custom Converter Classes
- Implementing Custom Validator Classes
- Registering Custom Validators
- Validating with Bean Methods
- Supplying Attributes to Converters
- Validating Relationships Between Multiple Components
7. Event Handling
- Life Cycle Events
- Value Change Events
- Action Events
- Event Listener Tags
- Immediate Components
- Passing Data from the UI to the Server
- Phase Events
- Putting It All Together
8. Subviews and Tiles
- Common Layouts
- A Book Viewer and a Library
- The Book Viewer
- Content Inclusion in the Book Viewer
- The Library
9. Custom Components, Converters, and Validators
- Classes for Implementing Custom Components
- Encoding: Generating Markup
- Decoding: Processing Request Values
- Implementing Custom Component Tags
- Revisiting the Spinner
- Using Child Components and Facets
- Implementing Custom Converters and Validators
10. External Services
- Database Access with JDBC
- Configuring a Data Source
- An Introduction to LDAP
- Managing Configuration Information
- Container-Managed Authentication and Authorization
- Using Web Services
- Ajax Fundamentals
- Form Completion
- Realtime Validation
- Propagating Client-Side View State
- Direct Web Remoting
- Ajax Components
12. Open Source
- Web Flow—Shale
- Alternate View Technologies—Facelets
- EJB Integration—Seam
13. How Do I ...
Web User Interface Design
- How Do I Find More Components?
- How Do I Support File Uploads?
- How Do I Show an Image Map?
- How Do I Include an Applet in My Page?
- How Do I Produce Binary Data in a JSF Page?
- How Do I Show a Large Data Set, One Page at a Time?
- How Do I Generate a Pop-up Window?
- How Do I Selectively Show and Hide Components?
- How Do I Customize Error Pages?
- How Do I Use JSF with Eclipse?
- How Do I Locate a Configuration File?
- How Can a JSF Component Access Resources From a JAR File?
- How Do I Package a Set of Tags into a JAR File?
- How Do I Carry Out Initialization or Cleanup Work?
- How Do I Store a Managed Bean Longer than Request Scope But Shorter Than Session Scope?
- How Do I Extend the JSF Expression Language?
Debugging and Logging
- How Do I Decipher a Stack Trace?
- How Do I Avoid the “Stack Trace From Hell”?
- How Do I “Hot Deploy” My Application?
- How Do I Comment Out a Part of a JSF Page?
- How Do I Find the Logs?
- How Do I Find Out What Parameters My Page Received?
- How Do I Turn on Logging of the JSF Container?
- How Do I Debug a Stuck Page?
- How Do I Find the Library Source?
- Web User Interface Design
- Title: Core JavaServer
- Release date: May 2007
- Publisher(s): Prentice Hall
- ISBN: 9780131738867