JavaServer Faces in Action – Kito Mann

If your curious as to why I make posts about books I read it’s because I cannot remember everything I read. I’ve read many books over the past few years and I can hardly remember the names. At least by making a post about each I know which books I’ve read, when I finished them and what was my take on the book. Maybe if I’m lucky my posts will help steer somebody towards or away from a particular book.

Last week I finished making my way through another techie book. This time I was reading JavaServer Faces in Action by Kito Mann. It is one of the two most popular JSF books. The other is Core JavaServer Faces by David Geary and Cay Horstmann. I haven’t sat down to read Core JSF, but I have skimmed it and used it as reference.

If you are interested in learning JavaServer Faces either book is fine. The In Action book did a decent job walking you through JSF from start to finish. A few chapters are dedicated to a working example JSF application. The only complaint I have, and this may be unwarranted, is that there is no chapter explaining JSF best practices. I’m finding it very difficult to get good information about how to best use JSF in an application. This may be an unwarranted complaint since both books are really just “starter” books. Best practices would probably require a complete book.

I started to realize long ago that learning anything about Java requires you to learn in layers. Learning JSF is no different. It is what I think of as a high level layer; it’s built on top of many other layers. To fully understand JSF and use it to the fullest potential you need to be aware of each layer. It would be even better to struggle using each successive layer, to appreciate the improvements.

The first layer is obviously the Java language. To write web applications using the Java language you use Servlets. This is the second layer. Servlets are great, but they can be difficult to use for certain sites. The third layer is JSP. A nice, easy to use language that gets compiled into servlets. Not exactly a layer on top of JSP, but maybe at the same level is JavaServer Faces. Faces has a controller servlet and the default view language is JSP.

To fully use JSF it’s best to know and understand: Java, Servlets, JSP, JSP taglibs, and JSF. I don’t see how anybody could jump right into JSF without first knowing and understanding the underlying concepts of Servlets.