My previous post received slightly wider distribution and attention than I am normally used to, and unfortunately my little rant/in-joke aimed at JSF & Struts at the very end somewhat detracted from the more serious and core points of the post itself.
Firstly, me and Peter Thomas have a little in-joke going on, whereby we take little jabs at JSF at every opportunity - sort of a modern day geek in-joke equivalent of Cato the Elder who used to end all his speeches in the Roman Senate, regardless of subject with the words “Furthermore I think Carthage must be destroyed”.
Struts - Got Java Web Frameworks Going, Now Outdated
Let’s start with Struts: Struts did an excellent thing once upon a time in that it got the Java Web Framework bandwagon going in a serious way - it became a de facto standard and generally improved the structure of JVM webapps.
However, as much as JVM web frameworks owe a debt of gratitude to the trailblazing work Struts did, Struts is now outdated and antiquated in comparison to other, newer and better frameworks that have taken the lessons learned from Struts and refined many of the rough edges away.
JSF - Vendorware At Birth, Filled With Bad Ideas
So, to my favourite subject of disparage, JSF. Firstly, JSF 1.0 quite literally was donkey poo, and I stand by that statement: “POST” only and a lack of bookmarkable GET URL support is an inexusable omission for anything even aiming to be a web framework. Massively leaky abstractions whereby a developer must know all about the inner workings and lifecycles of the framework was another glaring shortcoming to name a few. There where numerous other objections I had at the time to JSF 1.0 which are still valid, at least for JSF 1.0.
I understand many/some of these shortcomings have been addressed with JSF 2.0, and others by various vendor extensions. Still, I’m not convinced:
I simply don’t like the idea of tag-libs. Why should a developer learn JSF tags, which JSF is largely built around, when HTML/JS/CSS already exist? What is the point? It just seems a bad idea to me when HTML and CSS are the language of the web, not JSF tags.
To be completely fair on JSF, I haven’t tried it since the 1.x days, but at the time it was so thoroughly flawed, that I find it hard to believe that everything would be addressed in 2.0 unless it is a complete rethink from scratch.
There Are So Many Other Choices That Are Better
With the age of Struts showing, and the many shortcomings of JSF, I find that there simply is no good reason to use one of them, given the multitude of other, decent JVM based web frameworks, just to mention a few:
- Spring MVC,
- Play Framework
- Scalatra + Scalate
The above are just a few JVM based web frameworks targeting different types of problems that quickly come to mind that I would prefer using over JSF and Struts. Why choose Struts or JSF if you have a choice?