The anticipated conclusion to my two part article on how to improve the performance of your JSF-based Seam application by two orders of magnitude is finally available at JSFCentral. I've also released the source code cited in the article.

The promised gains are achieved primarily by leveraging partial page rendering provided by the RichFaces component library and some extra effort to slim down the size of the response. Partial page rendering is Ajax at its finest. It cuts out the main bottleneck of most traditional web applications, which is the overhead of rendering the entire page and its assets, and instead redraws only what is needed as the user interacts with the application. This technique makes the application feel incredibly responsive.

The best part about RichFaces is that it makes partial page rendering so simple that there's really no reason not to use it. Instead of having to write low-level Ajax network calls, RichFaces provides a declarative approach to Ajax. Using either the supplemental Ajax4jsf component tag set or the fully Ajax-aware components in the RichFaces component tag set, you can specify which areas of the page should be updated and the rest is left up to the framework. The normal JSF postback is sent over an Ajax bridge and the Render Response phase supplies the partial page to update.

There's no question, though, that there has been a dearth of good documentation about how to use the RichFaces tags. Fortunately, both a book and reference card have been published recently which should guide you through the myriad of components and settings in RichFaces and help you wield its potential.

Max Katz addresses just how practical RichFaces is in his book Practical RichFaces, published by Apress. This book sorts out the history of RichFaces, guides you through the myriad of component tags and attributes in RichFaces, and allows you wield its potential. You learn that Ajax and JSF are a good fit for one another and the combination allows you to do Ajax without having to suffer the headache of coding JavaScript and dealing with browser inconsistencies. I recently had a chance to read the book and afterwards posted my review on Amazon. It's my recommendation that if you are using RichFaces, you should definitely take the opportunity to read this book.

If you need a reference to have on the go, then grab a copy of the DZone RichFaces Refcard (PDF), authored by members of the RichFaces project team. This card helps you keep the RichFaces and Ajax4jsf tags sorted and reminds you of the many attributes from which you have to choose.

To see examples of how to use RichFaces and Seam together, then check out chapter 12 of Seam in Action.

If you want to be able to retain the attention of your users in this fast paced world, which has a ever diminishing tolerance for long page loads, you should always consider using Ajax in your application. RichFaces offers a great way to get started. Another excellent JSF component library to consider if you want to add partial page rendering to your application is ICEfaces. In fact, it's arguably simpler to use because it automatically determines which areas of the page to update based on deltas in the component tree. So you have two good options to get started.

Back to top