Last week, at the Colorado Software Summit, I gave a session on RESTful Web Apps. In this session, I made a comment that the proponents of JSF failed to consider the web architecture, and that it is not fixable. My goal in that session was to point out the consequences of design choices made by some web frameworks, but not necessarily to point fingers at those frameworks.
Matt Riable attended my session, and shared his notes on his blog at RESTful Web Applications with Subbu Allamaraju. His post incited some comments, to one of which I would like to respond here.
Diego Plentz said that
I haven't come to the conclusion that JSF is not fixable yet. It looks like there are some major overhauls going on related to state saving and RESTful URLs in JSF 2.0.
I think this comment misunderstands what it means to be "RESTful". The ability of an app to create a link that can be submitted via GET to some non-JSF app does not make the app RESTful. Period. I don't have problems with JSF focusing on usability, but I do think it should have paid attention to the web architecture. Given that JSF is a Java standard, those who want to rely on standards have no choice but to build web apps that fail the web architecture and can not take advantage of common web infrastructure. The design choices made in JSF are poor, and I don't see an exit strategy other than dumping the current standard, and going back to the drawing board. Bill de hÓra echoed a similar thought:
But it’s hard to be non-critical about a spec that got things so wrong – not just REST, but basic HTTP usage. A JSF that supports REST is going to be a complete overhaul, no?
I have not read the latest JSF 2.0 draft thoroughly, but upon a quick reading of all the changes, I don't see anything to address the basic web usage. Unless there are more changes coming that will magically fix the core without an overhaul, JSF should the follow JAX-RPC into the JSR-graveyard.
Looking at some of the heated comments below and the links posted, I can't help but comment that JSF (community) has recently discovered the web architecture, viz., that GET is the de facto means of navigation and that POST is an exception and used solely for unsafe and non-idempotent operations. This is unfortunate for a standard. Secondly, the ability to pass parameters to a URI does not fix JSF as long as JSF's notion of a form is always driven by POST. That does not make JSF a bad framework, it just makes it a special-purpose framework that can be used to build certain kind of stateful applications. That, IMHO, is a too low a bar for a standard framework.