JSF (A love and hate story, endless yet)

When I first met JSF I was having another relationship. I had been for 2 years with Struts. In the beginning it seemed to me (Struts) dull and thorny (I had just had a long affair with PHP), but when I met its parents Validator and Tiles, I fell in love. I was convinced by their configuration-files-for-everything approach, and its action-oriented workflow seemed to be a natural way to develop MVC.

In a travel I was presented JSF, and the first sight couldn't be more half-hearted. I felt I was doing just the same, and with worse tag libraries. Furthermore, it was not alone, but came with Spring and IBatis, so breaking the ice was even more difficult. Thinking on components and events? What for?

Suddenly, a third one came into my way and everything turned clearer: Ajax. Everything made sense. A text field would never ever be an empty box until somebody presses a button. Now, a text field deploys suggestions, connects to the server to asynchronously validate itself, activates and disables page fragments... And if you want to develop this the good way, JSF is a must.

This is the beautiful part of every love story, but every good thing has a catch: JSF is a very limited standard in term of components (and I am not the only one who says it). JSF is only a framework you can use as basement for something really interesting. It was born in 2004 as Sun fix to the gap at presentation layer at J2EE, but it was not only until Ajax when people has invested on it.

Implementations (MyFaces, Sun RI, Facelets...), frameworks (Ajax4JSF, ICEFaces, Tobago...) and component libraries (RichFaces, Tomahawk, jMaki...) promise a lot, but managing to make them work together is often annoying. Bad documentation, incompatibilities, the need for betas, sandboxes, nightshots...

Despite it, I think JSF is the best choice for MVC if you want Ajax. More specifically, (MyFaces + Tomahawk (a must)) + (Ajax4JSF + RichFaces (really powerful)). First ones give an stable enough and comprehensive base set, and latter, the full power of Ajax.

P.D.: MyFaces won't stop. They've recently delivered 1.2. In the wiki there's a good amount of JSF, MyFaces and even integration with other libraries.

P.D.2: interesting graph on Ajax for different technologies.

It comes from a J2EE Framework comparative, really up-to-date.