Taming JSF 1.1
A couple weeks ago, I received an e-mail from Ray Davis of University of California, Berkeley. In the e-mail, he provided me a link to his team's Confluence Wiki - where he describes their experience and frustrations with JSF 1.1. I really like how Ray explains the problems they experienced, as well as how they fixed them. The "request thread" scope they created sounds similar to what Spring Web Flow does.
Our experience left us very happy with Spring, moderately happy with Hibernate, and not at all happy with JSF. We did manage to deliver a Pilot Gradebook that told us what we needed to know, but sacrificed reliability, consistency, and scalability to do so.
In January 2005, when we moved to full-time work on the official Sakai 2.0 Gradebook, JSF was our biggest concern.
It's a good read for those looking to jump into JSF. I think JSF 1.2 will solve a lot of problems, but who knows how long it will take to get a RI and MyFaces version of that.
JSF 1.2 is available for download from http://javaserverfaces.dev.java.net. One catch, it uses JSP 2.1 which is currently only available in Sun's Glassfish project.
An alternative is to look at Facelets. There were a lot of issues with JSP and JSF integration-- which is where a lot of people's headaches came from as the article highlights. Especially things like variable management and scope.
Facelets works with JSF 1.1 (MyFaces) and JSF 1.2 (RI) and leverages EL and variable management in such a way that there's no need to wait for JSP 2.1. On top of that, Facelets has templating built right into the Framework, it's not an after thought and highly performant as a first class benefit of Facelets (http://hookom.blogspot.com/2005/05/facelets-templating.html).
Releases are available from http://facelets.dev.java.net and intitial documentation is available here. Matthias from Apache MyFaces demonstrated Facelets at ApacheCon and said it was a hit with the people he talked to.
Right now it's still in pre-production grade as we are trying to finish up some last features to make it 'the' choice for JSF development. It's extremely lightweight and is able to take a 7K JSF page and construct a component tree from it in a tenth of a millisecond. Best of all, it looks exactly like a JSPX page, but has the same features as Tapestry with 'jwcid' ('jsfc' in Facelets case).
Posted by Jacob Hookom on July 28, 2005 at 01:45 AM MDT #
Posted by Matt Raible on July 28, 2005 at 03:56 AM MDT #
Posted by Jacob Hookom on July 28, 2005 at 04:23 AM MDT #
Posted by Gary on July 28, 2005 at 02:11 PM MDT #
Thanks for your comments Gary (and Matt, I promise to leave the sandwich boards at home from now on ;o)
I've taken a look at Clay, and Facelets has a lot of the same features that may be considered more familiar to JSP developers with templating and re-use. I would be intersted in tying in Shale's UIComponents into Facelets, but it would probably something that would happen through the MyFaces group.
Posted by Jacob Hookom on July 28, 2005 at 05:07 PM MDT #
Posted by Ray Davis on July 28, 2005 at 05:58 PM MDT #
Posted by Greg on July 29, 2005 at 01:26 AM MDT #
Here's a short list of fixes that would have benefitted Sakai's project:
Handling multiple Views: Ed Burns worked quite a bit on the RI with state saving and multiple windows. While I'm not sure of the final outcome of his work, the issue was supposedly fixed.
Object Context/Session Scoping: Because of the new EL-Spec, you can provide any number of 'variable-spaces', including your own transaction variable space that's managed elsewhere. This means you could wire up something with Spring and specialized scopes for some work flow, invisible to any lifecycle or scope that's web related.
For example, backing each view with a bean could be handled by creating an ELResolver that always resolves the variable 'dialog' to a Spring bean that matches the current ViewId on the FacesContext. Simple :-)
AliasBean and Variables within a Page: The new EL has what's called a VariableMapper. This allows you to 'alias' expressions and have them work between 'includes' and JSTL. So things like c:forEach will properly work now. I'm still not sure how I was able to come up with a solution for this issue (maybe wisconsin beer?), but it magically fixes LOTS of problems with JSF integration in pages. Facelets is built upon this new EL implementation btw.
Other various bugs were fixed.
Posted by Jacob Hookom on July 29, 2005 at 01:55 AM MDT #
Posted by Ray Davis on August 08, 2005 at 11:21 PM MDT #