Documentation

You are viewing the documentation for the 2.7.8 release in the 2.7.x series of releases. The latest stable release series is 3.0.x.

§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.

Config API

  1. The Config API

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. Dependency Injection with Templates
  3. Common use cases
  4. 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 REST APIs with Play WS

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

Integrating with Akka

  1. Integrating with Akka

Internationalization with Messages

  1. Internationalization with Messages

Dependency Injection

  1. Dependency Injection with Guice
  2. Compile Time Dependency Injection

Application Settings

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

Testing your application

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

Logging

  1. Logging

Next: Config API