Shaun Abram
Technology and Leadership Blog
Web frameworks
There is no right answer to the question of what is the best Java web framework. Still I end up asking it to myself every time a new project crops up. I did a post on a related talk I saw at JavaOne last year, which provoked a lot of debate and some really interesting responses. More recently, this report from Zero Turnaround is useful and this comparison from Matt Raible is also well written.
I have also been swayed in the past by the Thoughtworks technology radar in which component based frameworks (which, I think, in the Java world includes JSF, Wicket and Tapestry) get a thumbs down e.g. see the May 2013 radar. GWT has also in the past (see July 2011 radar) been singled out as something to avoid. Presumably Vaadin falls in to the same ‘hold’ category. Full disclosure, I’ve had limited exposure to these types of frameworks personally though.
My own preference remains Spring MVC. It is relatively easy to setup (especially with Spring Boot), provides decent testing support, and obviously integrates well with the rest of the Spring ecosystem. I am admittedly biased due to already knowing Spring core, but so be it.
My recent, albeit limited, experience with Struts2 is that I have been fairly pleasantly surprised. It wasn’t as bad I was expecting! The Action classes, which are instantiated for each request, and hence threadsafe, are fairly easy to use and test. I am not so fond of the xml mappings and the variable passing that gets done there though. It seems kind of clunky, although there may be a better way I am not aware off.
Still, I am not likely to start using Struts by choice on my own projects anytime soon. Spring MVC remains my go-to web framework.
Tags: springmvc, struts, struts2, webframework
JavaOne: Comparing Java Web Frameworks
The first talk I attended at this year’s JavaOne was “Choosing Your Java Web Framework” by Richard Pack from salesforce.com
Overall, I found this a really interesting talk. It was lacking in any sales pitch, nor did it have the unquestioning devotion to one particular framework that I felt some of the Java FX talks had. Instead it seemed like an unbiased look at web frameworks in general and a handful of frameworks in more detail, based on Richard’s extensive and hands on experience and SalesForce and Hyperic.
Read more
Tags: grails, gwt, javaone, javaone2011, jsf, tapestry, webframework, wicket
Spring MVC Hello World
There is a good Getting Started with Spring MVC blog post over on the Spring team blog.
I have created several Spring MVC projects for both work and play, and am attaching my own simple version of the HelloWorld example here, based on the Spring blog example.
Find my maven ready source here.
Like my previous JSP/Servlet example, I find these templates useful for getting prototypes up and running.
Tags: helloworld, jsp, servlet, spring, springmvc, webapp, webframework