Documentation

You are viewing the documentation for the 2.4.0-M3 development release. The latest stable release series is 3.0.x.

§What’s new in Play 2.4

This page highlights the new features of Play 2.4. If you want learn about the changes you need to make to migrate to Play 2.4, check out the Play 2.4 Migration Guide.

§Dependency Injection

§Embeddable Router

§Logging enhancements

§Java 8 support

Before:

return promise(new Function0<Integer>() {
  public Integer apply() {
    return longComputation();
  }
}).map(new Function<Integer,Result>() {
  public Result apply(Integer i) {
    return ok("Got " + i);
  }
});

After:

return promise(() -> longComputation())
    .map((Integer i) -> ok("Got " + i));

§Java Testing

A new RequestBuilder replaces FakeRequest and RequestBuilder will build a request that is actually a Request. FakeRequest was not a Request which meant it was not interopable with many of the Play APIs. This improvement makes it much easier to instantiate a controller and call a method on it during testing.

§Maven/SBT standard layout

§Anorm

Next: What's new in Play 2.3?