Core JavaServer Faces / Edition 3

Paperback (Print)
Rent from
(Save 59%)
Est. Return Date: 09/10/2014
Used and New from Other Sellers
Used and New from Other Sellers
from $18.43
Usually ships in 1-2 business days
(Save 69%)
Other sellers (Paperback)
  • All (21) from $18.43   
  • New (12) from $32.72   
  • Used (9) from $18.43   


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

  • Three totally new chapters on using Facelets tags for templating, building composite components, and developing Ajax applications
  • Guidance on building robust applications with minimal hand coding and maximum productivity–without requiring any knowledge of servlets or other low-level “plumbing”
  • A complete explanation of the basic building blocks–from using standard JSF tags, to working with data tables, and converting and validating input
  • Coverage of advanced tasks, such as event handling, extending the JSF framework, and connecting to external services
  • Solutions to a variety of common challenges, including notes on debugging and troubleshooting, in addition to implementation details and working code for features that are missing from JSF
  • Proven solutions, hints, tips, and “how-tos” show you how to use JSF effectively in your development projects

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.

Read More Show Less

Product Details

  • ISBN-13: 9780137012893
  • Publisher: Prentice Hall
  • Publication date: 6/17/2010
  • Series: Sun Core Series
  • Edition number: 3
  • Pages: 636
  • Sales rank: 542,628
  • Product dimensions: 6.90 (w) x 9.00 (h) x 1.40 (d)

Meet the Author

David Geary is president of Clarity Training Inc. (, a training and consulting company and is the author of eight books on Java technology, including the best-selling Graphic Java™ 2 series (1999), Advanced JavaServer Pages (2001), and Google™ Web Toolkit Solutions (2008), all from Prentice Hall. David is a member of the JSF expert group, a frequent speaker at many software conferences, a Java Champion, and is a three-time JavaOne Rock Star.

Cay S. Horstmann is principal author of Core Java™ Volumes I & II, Eighth Edition (Prentice Hall, 2008). Cay is a professor of computer science at San Jose State University, a Java Champion, and a frequent speaker at computer industry conferences.

Read More Show Less

Table of Contents

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

Immediate Components 320

Passing Data from the UI to the Server 324

Phase Events 328

System Events [JSF 2.0 Topic] 329

Putting It All Together 338

Conclusion 345

Chapter 9: Composite Components [JSF 2.0 Topic] 346

The Composite Tag Library 348

Using Composite Components 350

Implementing Composite Components 352

Configuring Composite Components 353

Attribute Types 354

Required Attributes and Default Attribute Values 355

Manipulating Server-Side Data 356

Localizing Composite Components 359

Exposing a Composite’s Components 360

Facets 365

Children 366

JavaScript 368

Backing Components 373

Packaging Composite Components in JARs 382

Conclusion 383

Chapter 10: Ajax [JSF 2.0] 384

Ajax and JSF 386

The JSF Life Cycle and Ajax 387

The JSF Ajax Recipe 388

The f:ajax Tag 389

Ajax Groups 392

Ajax Field Validation 394

Ajax Request Monitoring 396

JavaScript Namespaces 398

Handling Ajax Errors 400

Ajax Responses 400

The JSF 2.0 JavaScript Library 403

Passing Additional Ajax Request Parameters 405

Queueing Events 407

Coalescing Events 408

Intercepting jsf.ajax.request() 409

Using Ajax in Composite Components 409

Conclusion 416

Chapter 11: Custom Components, Converters, and Validators 418

Implementing a Component Class 420

Encoding: Generating Markup 424

Decoding: Processing Request Values 427

The Tag Library Descriptor [JSF 2.0 Topic] 433

Using an External Renderer 438

Processing Tag Attributes [JSF 2.0 Topic] 441

Encoding JavaScript 453

Using Child Components and Facets 457

Saving and Restoring State 468

Building Ajax Components [JSF 2.0 Topic] 473

Implementing Self-Contained Ajax in

Custom Components 475

Conclusion 484

Chapter 12: External Services 486

Database Access with JDBC 487

Configuring a Data Source 495

Using the Java Persistence Architecture 507

Container-Managed Authentication and Authorization 519

Sending Mail 532

Using Web Services 537

Conclusion 544

Chapter 13: How Do I . . . ? 546

How do I find more components? 547

How do I support file uploads? 548

How do I show an image map? 557

How do I produce binary data in a JSF page? 559

How do I show a large data set, one page at a time? 568

How do I generate a pop-up window? 573

How do I selectively show and hide parts of a page? 581

How do I customize error pages? 582

How do I write my own client-side validation tag? 588

How do I configure my application? 595

How do I extend the JSF expression language? 596

How do I add a function to the JSF expression language? [JSF 2.0 Topic] 599

How do I monitor the traffic between the browser and the server? 601

How do I debug a stuck page? 602

How do I use testing tools when developing a JSF application? 604

How do I use Scala with JSF? 605

How do I use Groovy with JSF? 607

Conclusion 608

Index 609

Read More Show Less

Customer Reviews

Average Rating 4
( 4 )
Rating Distribution

5 Star


4 Star


3 Star


2 Star


1 Star


Your Rating:

Your Name: Create a Pen Name or

Barnes & Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation


  • - By submitting a review, you grant to Barnes & and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Terms of Use.
  • - Barnes & reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing all of 4 Customer Reviews
  • Anonymous

    Posted October 18, 2012



    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted June 1, 2007

    quicker coding of Java web servers

    [A review of the 2ND EDITION published in 2007.] Respected Java authors Geary and Horstmann provide an update of the first edition of their book. The key theme is a faster and more robust coding of web servers using Java. From about 8 years ago, Java Server Pages and Java servlets were the recommended approach. But while doable, it proved quite grungy, with lots of low level code needed. Plus, Microsoft cranked up the competitive pressure with their .NET approach, that had a nice IDE. The collective response by Sun is given here, with JSF 1.2. The book's code examples demonstrate a tight integration with XML configuration files. These files can encode things like navigation rules and action attributes. A file can be considered to define a server's state. Some files are lengthy. But the good thing is that you rarely have to edit these by hand. The standard JSF tags are shown to lead to the building of sophisticated dynamic HTML pages. Much simpler than explicit coding of JSPs. Another bonus for the programmer is the existence of a comprehensive set of standard validators. These let you check user inputs and filter out invalid choices, before they get into your backend database. Important recent topics like using Ajax or implementing a Web Service are also treated. Ajax and JSF are entirely compatible. This combination of improved client side abilities and server side functionality is easy to understand, from the text's examples. Some readers might wish for a lengthier discussion. Only 1 chapter is devoted to this. The treatment of Ajax itself is necessarily brief, as this is primarily a book on JSF, not Ajax. But there's enough to get you started.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted August 5, 2004

    Drag and drop development

    Java Server Pages (JSPs) and servlets are at the core of many J2EE web applications. But thus far, building the code to implement a particular HTML front end has been totally manual. In spite of this, many Java programmers have successfully taken up the approach. Geary and Horstmann show how this can be replaced by JSF, promising potentially far greater productivity at assembling the UI. Necessary if J2EE is to better compete against powerful UI builders in the .NET environment. There is a slight awkwardness in this book, born of necessity. The authors show how to write JSF code by hand, using just a text editor. This can still offer advantages over the previous JSP/servlets. But the full promise of JSF has to await the emergence of visual development environments (VDEs) that can graphically represent components. Then you can drag and drop an instance of a component onto a central window and customise it. The VDE can then autogenerate the JSF tag code. Very early in the book, the authors show a simulated illustration of this. Hopefully, by the time you read the book, at least one such VDE will be available. This promise of incipiently greater productivity should be clear. It mimics what happened in circuit design in the 1980s. Spice programs could simulate a circuit. But the input that defined a circuit was a text netlist file, which had to be written by hand, from a handdrawn circuit diagram. As PCs came on the scene, MicroSim came out with a version of Spice where the UI let you drag and drop elements to make a circuit. Far easiere and less error prone. Hopefully, JSF will give us a similar gain.

    Was this review helpful? Yes  No   Report this review
  • Anonymous

    Posted July 23, 2012

    No text was provided for this review.

Sort by: Showing all of 4 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)