Documentation

§Main concepts for Scala

This section introduces you to the most common aspects of writing a Play application in Scala. 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 Scala and Java are separated into different packages. All the Scala APIs are under the play.api package; all the Java APIs are under play. For example, the Scala MVC API is under play.api.mvc and the Java MVC API is under play.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. Handling errors

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 format

Form submission and validation

  1. Handling form submission
  2. Protecting against CSRF
  3. Custom Validations
  4. Custom Field Constructors

Working with Json

  1. JSON basics
  2. JSON with HTTP
  3. JSON Reads/Writes/Format Combinators
  4. JSON automated mapping
  5. JSON Transformers

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 Slick to access your database
    1. Using Play Slick
    2. Play Slick migration guide
    3. Play Slick advanced topics
    4. Play Slick FAQ
  3. Using Anorm 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 Pekko

  1. Integrating with Pekko

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. HTTP request handlers
  3. Essential Actions
  4. HTTP filters

Testing your application

  1. Testing your Application
  2. Testing with ScalaTest
  3. Writing functional tests with ScalaTest
  4. Testing with specs2
  5. Writing functional tests with specs2
  6. Testing with Guice
  7. Testing with compile-time Dependency Injection
  8. Testing with databases
  9. Testing web service clients

Logging

  1. Logging

Next: Configuration API


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. Have questions or advice to share? Go to our community forums to start a conversation with the community.