Documentation

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

§The Typesafe Config API

Play uses the Typesafe config library as the configuration library. If you’re not familiar with Typesafe config, you may also want to read the documentation on configuration file syntax and features.

§Accessing the configuration

Typically, you’ll obtain a Config object through Dependency Injection, or simply by passing an instance of Config to your component:

package controllers

import com.typesafe.config.Config;
import play.mvc.Controller;

import javax.inject.Inject;

public class MyController extends Controller {

    private final Config config;

    @Inject
    public MyController(Config config) {
        this.config = config;
    }
}

§API documentation

Since Play just uses Config object, you can see the javadoc for the class to see what you can do and how to access configuration data.

Next: HTTP programming