The Play Team is proud to announce the release of Play 2.7.0. This release adds many new features and continues our efforts to make Play more modular, flexible, and secure. Play 2.7.0 is the result of more than 1 year of relentless work from our fantastic community comprehending more than 720 changes made from almost 150 contributors.
The highlights in Play 2.7.0 include:
gRPC is a transport mechanism for request/response and (non-persistent) streaming use cases. It is a schema-first RPC framework, where your protocol is declared in a protobuf service descriptor, and requests and responses will be streamed over an HTTP/2 connection. Play now offers play-grpc which is a module built on top of akka-grpc and gives you experimental support to declare your services in this format. See Akka gRPC's documentation on Why gRPC? for more information about when to use gRPC as your transport.
Akka Coordinated Shutdown
Play 2.6 introduced the usage of Akka's Coordinated Shutdown but still did not use it all across the core framework or expose it to the end user. Coordinated Shutdown is now used internally to handle Play's lifecycle.
The main advantage is that it gives you fine-grained phases where you can register tasks instead of just having a single phase like Play's application lifecycle. For example, you can add tasks to run before or after server binding, or after all the current requests finishes.
New cache implementation using Caffeine
Caffeine is a high performance, near optimal caching library based on Java 8. It is now the underlying cache library used by Play Cache APIs implementation since it is a much better option for a local cache than the version of EhCache we were using before.
Enhanced Content Security Policy support
There is a new Content Security Policy filter available that supports CSP nonce and hashes for embedded content. The previous setting of enabling CSP by default and setting it to
default-src 'self' was too strict, and interfered with browser plugins.
The CSP filter uses Google's Strict CSP policy by default, which is a nonce based policy.
Direct access to request data without
Historically, Play used
play.mvc.Http.Context as a way to access request information and set some response data. It is a crucial part of Java HTTP & MVC APIs, but it is not a proper abstraction of how these APIs should work. You can now make your actions directly receive the request as a parameter, and consistent APIs were added to manipulate its data and the response.
See our detailed migration guide for examples showing how to migrate to the new APIs.
Major library updates
Play 2.7 brings a new version of most of its dependencies. The updates mainly include new features, security and overall fixes. See a list of the most important updates in our migration guide. Of course, we are also bringing the latest version of our own libraries such as Play JSON, Play-WS and Twirl.
Many improvements in Java Forms API
Java Forms APIs bring a good number of improvements like binding for file uploads, better support for advanced validation, and repeatable constraints.
New HTTP Error Handlers that are more suitable for REST APIs
Play 2.7 brings two new error handlers — one targeting REST APIs which will return errors formatted in JSON. The second one returns HTML or JSON errors based on the preferences specified in client’s Accept header, and it is a better option if your application uses a mixture of HTML and JSON, as is common in modern web apps.
As usual, you can see the more details of those new features in the release highlights and learn how to migrate in our migration guide. See the milestone for a more comprehensive list of changes.
How to start or migrate to Play 2.7
To get started with Play, follow the instructions in our Try Play page. And if you need to migrate from an older version to Play 2.7, see our migration guide.
Thanks to our contributors
Finally, many, many thanks to the community for their help with detailed bug reports, discussion about new features, and pull requests.
Thanks to Lightbend for their continued sponsorship of the Play core team's efforts. Lightbend offers commercial support for Play.
Special thanks to the following contributors who helped with this release:
145 Matthias Kurz 134 Marcos Pereira 85 Greg Methvin 36 Rich Dougherty 24 Play Team 17 Will Sargent 17 Ignasi Marimon-Clos 17 Dale Wijnand 16 Schmitt Christian 10 Tim Moore 9 Renato Cavalcanti 8 Lousanna 6 Arnout Engelen 6 Ben McCann 6 Shunsuke Otani 5 sullis 5 Roman Parshikov 4 Shruti Singh 4 James Roper 4 Cédric Chantepie 4 Koen De Groote 4 Shenker93 3 kenji yoshida 3 Zack Grannan 3 Pongpira Upra 3 jxtps 3 Nathan Coleman 2 Erik LaBianca 2 Arne Schuldt 2 Andrii 2 Reto Habluetzel 2 joymufeng 2 Toshiyuki Takahashi 2 techmoksha 2 mufeng 2 Tomek Kopczynski 2 Adam Lane 2 Alvaro Pereyra 2 Thiago Arrais 2 Manogna M 2 rmcloughlin 2 James Petty 2 Dmitry Avershin 2 Jules Ivanic 2 Aristotelis Dossas 2 Guylian 2 yuuri111 2 Christian Treppo 2 Kamil Duda 2 Radim Kolar 2 danoliv 1 Peerapat A 1 Pierre Court 1 Quentin PROUST 1 Rafael Zanella 1 Rajesh Pitty 1 Ruth Stento 1 Ryan Peters 1 Sean Glover 1 Sergey Chupov 1 Sergey Novikov 1 SheldonSoftdev 1 Shunsuke Tadokoro 1 Stephen Marsh 1 Takahiro Takashima 1 Tanin Na Nakorn 1 Taylor Raack 1 Thibault Meyer 1 To-om 1 Ty Kowalewski 1 Tzu-Chiao Yeh 1 Valentin Stoyanov 1 Valy 1 Veselin Slavchev 1 Vincent Munier 1 Yawar Amin 1 Yinan Ding 1 YuitoSato 1 Yury Gribkov 1 cdow 1 chenweisomebody126 1 ctoomey 1 denisname 1 duncangodwin 1 dusanstanojeviccs 1 Aakash Jain 1 katainaka 1 kerami 1 markglh 1 nafg 1 natefitzgerald 1 nwalsh1995 1 ozencem 1 picimaci 1 sarathraj 1 sweety98 1 fghzxm 1 Adam Williams 1 Aidara Moussa 1 Akhil Vijayan 1 Alain Defrance 1 Alexandr Tarasyuk 1 Alexis Hernandez 1 Amit Mhatre 1 Ben Nelson 1 Bora Kaplan 1 Caio Novaes 1 Claudio Bley 1 Daniel Manchester 1 Daniel Reigada 1 Derek Wickern 1 Dominik Dorn 1 Elijah Rippeth 1 Eliot Chan 1 Gabriel Klappenbach 1 Gui Becker. L 1 Guillaume Galy 1 Hajime Shiozawa 1 Henri Cook 1 Ivan Orone 1 Ivar Abrahamsen 1 Jakub Kozłowski 1 Jean-Philippe Melanson 1 Joe Kutner 1 Johannes Stickel 1 John Duffell 1 John Gutierrez 1 Juan J. Martínez 1 JunpeiAnzai 1 Justin Pihony 1 Justin du Coeur, AKA Mark Waks 1 Kavit 1 Kazuhiro Sera 1 Konstantin Perikov 1 Lj Chen 1 Mariot Chauvin 1 Matthias Berndt 1 Matthias Erche 1 Maximilien Riehl 1 Nafer Sanabria 1 Naoki Takezoe 1 Natsumi 1 NickBlow 1 Nishan Patel 1 Onilton Maciel 1 Paul Porter 1 Pedro Rijo