Stanley has posted 1 posts at DZone. You can read more from them at their website. View Full User Profile

Core JavaServer Faces (2nd Ed)

  • submit to reddit
Published by: Prentice Hall PTR
ISBN: 0131738860

Reviewer Ratings




Buy it now

One Minute Bottom Line

If you want to learn JavaServer Faces (JSF), this is the book to learn it from! What is the best technique to learn a new technology? By examples, in my opinion. This book takes that approach to the extreme, by giving you full source for the discussed examples! This really helps to see the big picture. I really liked that style.

This book comes from the creators of JSF, so the material in the book is well researched. And it shows. You'll learn many tips that the authors have learned from writing the first edition of the book and by revising the JSF itself.

This is really an excellent book, and a true reference for JSF. When reading this book, I got a sense that the authors really care about the reader: they do the hard work so that the reader will have an easier time implementing/understanding JSF. This is really what sets this book apart from many others.


Chapter 1: Getting Started
What is JSF? "Swing for server-side applications," a short answer given by the authors. In this chapter, you get an excellent, detailed explanation of how JSF works, and also how to create and run the sample application from the book. The authors' style is clear and unambiguous. Excellent start (we'll see if it continues).
Chapter 2: Managed Beans
A simple chapter, where you get to see a simple JSF application in action. Source for the whole app is shown, which helps a lot in seeing the big picture. Not only that, but the authors showed how to make the app internationalized! Bean scopes are also discussed.
Chapter 3: Navigation
A concise chapter on JSF navigation. The authors base their explanations on real, practical examples. I am beginning to like the author's style: a little theory with a short snippet, followed by the whole source code. In my opinion, this is a very good way to learn a new technology -- one I really like, you will also if you "learn by example".
Chapter 4: Standard JSF Tags
A reference chapter. And a long one. All of the HTML JSF tags are discussed. In this chapter, authors cover all of the available tags: forms, text, buttons, lists, selection tags, messages, panels, and more. Examples are shown, which provide a nice break and make this long chapter a little more readable.
Chapter 5: Data Tables
Tables. Tables. Tables. That's all that's in this chapter! If you want to put a table in your JSF page, connect it with some data source, this is the chapter for you! Very good overview on how to create tables, apply styles, include different components in it, and even how to create sortable tables (I agree with the author, this extra functionality should be built in JSF). As usual, full examples.
Chapter 6: Conversion and Validation
Fields on an HTML page are stored as strings. Java stores them as dates, numbers, etc. Thus, a conversion needs to take place. Not only that, the values need to be valid. In this chapter, the focus is on converting and validating those values. There are actually 2 portions/aspects that the authors focus on in this chapter: easy and difficult. The easy part is using the standard JSF to do the conversion and validation. The difficult part comes when you need to write a custom converter -- things get messy and difficult. JSF should be improved in this area. Not a fun chapter.
Chapter 7: Event Handling
In this chapter, the authors show how to handle events generated on the page by the user. This is a chapter, in my opinion, that show JSF's limitation and ugliness. There is no first-class support for JavaScript and AJAX, and it really shows. Also, the more advanced event handling, as the authors showed, requires way too much custom JSF code. In either case, the authors did a very good job showing how event handling works.
Chapter 8: Subviews and Tiles
A simple and a useful chapter on how to break a page into sections. The authors first showed how to accomplish this using just JSF using import statements. Then they explained how to do the task with Tiles, and finished the chapter with an explanation on how to extend Tiles.
Chapter 9: Custom Components, Converters, and Validators
Out of the box, JSF gives you almost everything you need to create a web application. But sometimes you might have to use something extra, something more custom. This chapter focuses on the advanced features: how to extend JSF by writing your own components, converters, and validators. It's not pretty and not easy: a lot of custom code needs to be written. In my opinion, this is another flow of JSF: the amount of code (and its difficulty) to write a custom feature is just overwhelming. Can't blame the authors, though, as they did a fine job sharing what it takes to do so.
Chapter 10: External Services
This is a practical chapter on how to use JDBC (configure a data source, connection pool), LDAP, container authentication, and web services. It seems a little out of scope and perhaps some of the configuration could be placed in an appendix. The authors do show how to do a complete task, along with integrating it with JSF. And as usual, you'll get to see full examples.
Chapter 11: Ajax
Does JSF have built in support for AJAX? No, but you can plugin the popular AJAX frameworks like Prototype, DWR, or Rico and use them with JSF. Or you can use a set of AJAX tags that were made specifically for JSF: Ajax4jsf. You'll read about these frameworks and extensions in this chapter. But this chapter is not complete. It only touches a surface on AJAX. And no full examples? In this chapter, full examples would be really helpful! A very light treatment of AJAX.
Chapter 12: Open Source
Shale, Facelets, and Seam: the three open-source projects that complement JSF. They're all covered in this chapter. Only a short overview of each is presented. Basically, the authors showcase some of the strong points of each framework. Same as in last chapter, it would be great if full source code was shown.
Chapter 13: How do I...
This is a problem-solution chapter. Focus in this chapter is on Web User Interface Design, Validation, and Programming. The authors gathered a list of common problems and provided solutions for those. In this chapter, and in most others, you get a sense that the authors really care about the reader: they do the hard work so that the reader will have an easier time implementing/understanding JSF. This is really what sets this book apart from many others.
Published at DZone with permission of its author, Stanley Kubasek.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)