Introduction date: 2011
Rating: 4/5
 
Play Framework makes it easy to create, build, and deploy web applications with Java & Scala. It is built on Akka, based on a lightweight and stateless architecture. It should be used for highly-scalable applications needing minimal CPU and memory resource consumption.
 

Links

 
 
Official Site Download GitHub Documentation
 
 

Pro

 
  • Easy to develop.
  • Fast though not fast as some other frameworks here.
  • Built on Netty, so it supports non-blocking I/O. This makes it excellent for RESTful applications where you need to handle remote calls in parallel.
  • Probably largest community among frameworks reviewed here
  • Quick project building and bootstrapping
  • Modularity
  • MVC
  • REST, JSON/XML, Web Sockets, non-blocking I/O
  • Just refresh the browser to see the recent changes.
  • Async support
  • Available books
 

Con

 
  • Version 2.0 is one of the most controversial Java frameworks. Switch to Scala made some Java developers outraged.
  • It does not offer backward compatibility; Play 2.X is a total rewrite of a Play 1.X.
  • For a lightweight framework (it’s marketed this way), it become somewhat bloated over time.
  • SBT. Intended as a Maven “killer”, never managed to outshine/replace it. It’s hard to understand and configure.
  • Not a servlet
  • Breaking changes across releases

 

Example

 
package controllers

import play.api._
import play.api.mvc._

class Application extends Controller {

  def hello(name: String) = Action {
    Ok("Hello " + name + "!")
  }

}
 

Author notes

 
Haters gonna hate, but I still like and prefer this framework. Unfortunately, I can’t give it more than 4/5 stars, I still believe that JAX-RS based frameworks are better for RESTful web services.
 
Introduction date: 2009
Rating: 3/5
 
RestExpress is a containerless light wrapper on the Netty HTTP stack that provides an easy way to create Java-based RESTful services.
 
RestExpress is aimed at supporting best RESTful practices, at least according to the RESTful Best Practices eBook.
 

Links

 
 
GitHub
 

Pro

 
  • Real micro-framework
  • Top performing, fast and reliable
  • XML/JSON
  • One of the oldest and most stable RESTful frameworks
 

Con

 
  • Non-existing documentation
  • Almost non-existing support
  • Small community

 

Example

 
package com.example;

import java.io.IOException;

import io.netty.handler.codec.http.HttpMethod;
import org.restexpress.RestExpress;

public class Main
{
	public static RestExpress startServer(String[] args) throws IOException
	{
		RestExpress server = new RestExpress();
		MyResource r = new MyResource();

		server.uri("/myapp/myresource", r)
			.method(HttpMethod.GET)
			.noSerialization();

		server.uri("/myapp/myresource", r)
			.method(HttpMethod.POST);

		server.bind(8080);
		return server;
    }

	public static void main(String[] args) throws Exception
	{
		RestExpress server = startServer(args);
        System.out.println("Hit enter to stop it...");
        System.in.read();
		server.shutdown();
	}
}
 

Author notes

 
Though extremely fast I don’t want to recommend this framework. Lack of documentation and almost non-existing support makes this a sub-par framework. I’m giving it 3/5 stars only on account of speed.
 
Introduction date: 2005
Rating: 4.5/5
 
Restlet is here to help Java developers build scalable and fast web APIs that following RESTful architecture pattern.
 
It offers powerful routing and filtering system, unified client/server Java API. It is available for all major platforms (Java SE/EE, Google AppEngine, OSGi, GWT, Android) and offers numerous extensions to fit the needs of all developers.
 
From my knowledge, it is a first RESTful web framework for Java. It’s also funny how so many companies are using this framework, but you’ll never know it. Like it’s almost ‘invisible’.
 

Links

 
 
Official Site GitHub Documentation
 
 

Pro

 
  • Powerfull
  • Enterprise framework
  • Available for Java SE, Java EE, Google Web Toolkit, Google AppEngine, Android, OSGi environments
  • vanilla JAX-RS supported (just like Jersey)
  • Offers most advanced RESTful support
  • HTTP, HTTPS, SMTP, XML, JSON, Atom, and WADL
  • Modularity
  • Other libraries are also supported
  • Still under active development
  • Smart url binding and full URI routing
  • Available books
 

Con

 
  • Very steep learning curve
  • Closed community, though openly active at StackOverflow
  • Not that popular these days, mostly thanks to Play Framework and Jersey

 

Example

 
public class Part03 extends ServerResource {

    public static void main(String[] args) throws Exception {
        // Create the HTTP server and listen on port 8182
        new Server(Protocol.HTTP, 8182, Part03.class).start();
    }

    @Get("txt")
    public String toString() {
        return "hello, world";
    }

}
 

Author notes

 
Somehow this framework is still very popular, considering its age and current competition. I can’t give it 5/5 stars because of its complexity but if you have time give it a chance, especially if you need a low-level RESTful access.
 
Continue Reading

  • Antonio Garcia

    Hi
    I use this framework in my last work. I pick over other for the benchmark. This is because the use of Jetty.
    I do not use the framework at 100%, the core and JDBI but the documentation is very terse = much StackOverflow.
    JodaTime is included what is interesting.

  • Edgar Espina

    Good article!

    Here is another micro framework: http://jooby.org (I’m the author)

    It runs on top of netty (default), jetty or undertow. It has a scripting programming model but also MVC.

    • Ahmmad Ismail

      I am pretty much considering your framework. However, It will be great if you can provide some video tutorials. Otherwise it is hard to gain confidence to get started for a project on which I will be stick to for next 4/5 years at least.

  • My advice, go to the Ionic official forum. Sort answers by “number of replies”, and you’ll find your answer somewhere on the top. It’s a standard Ionic question.

  • C B Newham

    I don’t know why you claim Spark is not intended for beginners. I’m no expert on restful frameworks (Spark was the first I used) but I found the documentation to be adequate and it does exactly what I want with minimal fuss.

  • Thanks I will check it out

  • Thanks I will check it out, do you mind if I contact you with few questions?

    • Feel free to contact me with any question you might have.

  • Jay Ma

    No RestEasy?

  • Danio

    Great article. Can you explain these two:

    “Most commonly used with AngularJS”
    – isn’t AngularJS alone enough to develop front-end and just call backend without use of Spark framework?

    “Can be used inside a container or without one”
    – you wanna tell it does not have to use Jetty at all.. it is configurable? I did not know that

  • Jonathan Airey

    Dropwizzard -> Dropwizard.

  • Yohanes Pradono

    I am new to Java and am building a simple restful application. I am considering Dropwizard, Jersey, or Play2. still struggling on where i should put my faith on.
    Which one is the simplest to deploy on server?
    I am developing on windows and my server uses Linux.

    • Ferran Maylinch

      Would recommend Spring Boot or Dropwizard. Not Play, it has too many issues.
      Dropwizard is easy to use. Spring Boot too, and Spring products are always of high quality and well documented.

  • Yohanes Pradono

    Does grails require you to know Groovy? or it can be developed using java only knowledge?

  • Hestia

    I wanted to use Jersey, but the teacher forces us to use an other frmaework.

  • Steve Hu

    I maintain a microservices framework benchmarks which can give you an estimate of overhead for each framework. As latency, throughput and memory footprint are three most important factors for microservices. Hope it helps.

    https://github.com/networknt/microservices-framework-benchmark