§Main concepts for Java

This section introduces you to the most common aspects of writing a Play application in Java. You’ll learn about handling HTTP requests, sending HTTP responses, working with different types of data, using databases and much more.

Note: The Play APIs for Java and Scala are separated into different packages. All the Java APIs are under the play package; all the Scala APIs are under play.api. For example, the Java MVC API is under play.mvc and the Scala MVC API is under play.api.mvc.

HTTP programming

  1. Actions, Controllers and Results
  2. HTTP routing
  3. Manipulating the HTTP response
  4. Session and Flash scopes
  5. Body parsers
  6. Actions composition
  7. HTTP Request Handlers / ActionCreator
  8. Content negotiation

Asynchronous HTTP programming

  1. Handling asynchronous results
  2. Streaming HTTP responses
  3. Comet
  4. WebSockets

The Twirl template engine

  1. Templates syntax
  2. Common use cases
  3. Custom formats

Form submission and validation

  1. Form definitions
  2. Using the form template helpers
  3. Protecting against CSRF

Working with Json

  1. Handling and serving JSON

Working with XML

  1. Handling and serving XML requests

Handling file upload

  1. Direct upload and multipart/form-data

Accessing an SQL database

  1. Configuring and using JDBC
  2. Integrating with JPA
  3. Using Ebean ORM

Using the Cache

  1. Using the Cache

Calling WebServices

  1. The Play WS API
  2. Connecting to OpenID services
  3. Accessing resources protected by OAuth

Integrating with Akka

  1. Integrating with Akka


  1. Internationalization

Dependency Injection

  1. Dependency Injection with Guice

Application Settings

  1. Application settings
  2. Essential Actions
  3. HTTP filters
  4. Error handling
  5. Global settings

Testing your application

  1. Writing tests
  2. Writing functional tests
  3. Testing with Guice
  4. Testing with databases
  5. Testing web service clients


  1. Logging

Next: HTTP programming

Found an error in this documentation? The source code for this page can be found here. After reading the documentation guidelines, please feel free to contribute a pull request.