Documentation

You are viewing the documentation for the 2.9.4 release in the 2.9.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.

Configuration API

  1. The Configuration API

HTTP programming

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

Asynchronous HTTP programming

  1. 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. Handling form submission
  2. Protecting against CSRF
  3. Using the form template helpers

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. Accessing an SQL Database
  2. Using an in memory H2 database
  3. Managing database evolutions
  4. Using JPA to access your database

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: Configuration API