Imagine a bacon-wrapped Ferrari. Still not better than our free technical reports.

The Ultimate Java Web Frameworks Comparison: Spring MVC, Grails, Vaadin, GWT, Wicket, Play, Struts and JSF

Part I: Warming up

A web framework can be like Marmite… you either love it or you hate it! WAT? You’ve never heard of marmite? Never mind, you’ll probably hate it anyway! It’s really important to be able to launch yourself into a new language or project and be productive quickly. Learning a Web Framework is no different.

This section will compare and contrast each Web Framework for each of the following categories ranking them with a score out of 5 with our comments.

  1. Rapid application prototyping
  2. Framework Complexity
  3. Ease of Use
  4. Documentation & Community

This time, we’ll be using a new unit, which we will use to measure the coolness of each framework. We shall call the new unit the “Beaker”

Next, in Part II will look into some of the deeper topics as we go undercover, Ninja style.

1. Rapid application prototyping

Whether you’re using the framework for the first time, or you’re an expert in all things framework related, it’s important to be able to develop quickly to prototype an idea or just try new things out. This section rates each framework for the ability to produce content from scratch with rapid results.

Spring MVC

If you’re looking for a framework to help you generate a application fast and clean, Spring really shouldn’t be your go to. It’s MASSIVE and hard to grasp if you’re just starting out. For a quick template, you can always download the Petclinic package and strip all of the unnecessary stuff out – but even that will take time, and you need to be able to tell what is necessary.

Spring Roo, a subproject of Spring that supports Spring Framework, Spring Security and Spring Web Flow, is Spring’s convention-over-configuration solution for rapidly building applications. It focuses on Java platform productivity, usability, runtime avoidance, lock-in avoidance, and extensibility via add-ons. It’s in the process of being expanded and has a lot of potential.

Score: 2.5/5  — Much preexisting Spring knowledge is needed. Plain JSP & Controllers do not provide out-of -the-box components and widgets that can be used.


Grails

Grails’ simplicity rocks. Next time we need to implement some small-to-medium CRUD application we’ll consider using Grails. The setup is very fast and scaffolding (code generation) saves a lot of time. Convention over configuration principle helps you to forget almost all of the configuration hassle.

Grails comes with a reloading mechanism out of the box, but it has some limitations (like it can only reload Groovy classes) and you may still want to use [Blatant Product Pitch] JRebel if a part of your project is in Java.

Score: 5/5 —  Top marks here. Scaffolding, conventions and hot code reloading, what else could you want?


Vaadin

The Vaadin directory is a component repository which provides existing components that users have implemented and contributed for others to use. If you choose to use something in the repository, you simply need to download the JAR and add it to your project and use it in your code straight away – template-tastic. At the time of writing this post, there are 365 components in the directory for you to use, one for every day of the year! You can’t get much more rapid than that ;)

Also, the design mode provides a drag and drop mechanism to add components and the code is generated for you, providing you with the exact layout you want, without even having to use the keyboard!

Score: 4.5/5 — Scaffolding and the Vaadin directory are both very impressive.

Your time is too valuable to sit around waiting for your code to redeploy. Seriously, imagine how much more you could accomplish if you choose to Eliminate Redeploys from your daily routine!

GWT

There are lot of pre-canned widgets for quick use but really anything you can do with JavaScript and the browser’s DOM can be done with GWT. If you prefer designing, you can also use GWT’s built-in Design Mode, an easy drag and drop interface with automatic code generation.

It’s no Grails, but the goal is to allow developers to productively develop web apps without being an expert in JavaScript, XMLHttpRequest, and various browser quirks.

Score: 4/5 — GWT is easy to create and maintain web apps widgets, and the built-in compiler takes care of efficiency and browser support.


Wicket

With its clear MVC model, clean HTML and a wicked component module, you can create new applications with reusable components quick and easy. Wicket does use a model inheritance for it’s components, which isn’t great due to a bit steeper learning curve.

The existence of markup files for every component gives you a clear separation of concerns between the controller deciding what to display and the view that specifies how to display. This not only reduces development time but also gives your web designers the confidence to modify the HTML code without worrying about crashing and destroying everything. Win!

Score: 3.5/5 — HTML and component structure with no need for configuration files.  Separation of components and how they display.  Model inheritance for components.


Play

Play is super simple to get started. The origination story of the framework essentially boils down to Java developers being envious of Ruby on Rails developers having a super fast prototyping framework. Play has a binary component similar to the Rails component of RoR, which is used for scaffolding and makes Play a little unconventional as a Java web framework. The Getting Started section of the Play framework documentation is a great basic tutorial and there’s a very low barrier to entry for developers to become at least moderately productive.

Score: 5/5 — Play has great documentation and the scaffolding works wonderfully.


Struts

Many devs see Struts as a legacy technology, so don’t expect fancy code generation in the place of boilerplate code. You need to configure a lot to start prototyping. An example project can be a good starting point. Something on the bright side: Struts has a Convention plugin, that enforces some convention over configuration and provides annotations to configure URL mappings and some other stuff. This should speed up things a bit.

Score: 2/5 — Lots of boilerplate code, no built-in code generation, no external powerful tools.


JSF

JSF is not fantastic for quick prototyping; code generation is not a built-in feature and prototype applications require just as much configuration as a full application. This is not really JSF’s fault, as it is reliant on the Java EE specification. JSF does have several useful Maven archetypes, however, that do provide a good starting point for a basic application. Prototyping can also be achieved with the vast array of sample projects available both online and bundled with many of the Java EE application servers. The biggest gains to productivity with JSF are the wizards available in most IDEs that generate most of the boilerplate code and configuration for you.

Score: 3/5 — The quick prototyping of JSF relies on the tooling around it. Maven and Netbeans provide archetypes and wizards to assist with getting started.

web-frameworks-rapid-application-prototyping-1

Framework Score

Grails

5

Play

5

Vaadin

4.5

GWT

4

Wicket

3.5

JSF

3

Spring MVC

2.5

Struts

2



DOWNLOAD THE PDF