Documentation

You are viewing the documentation for the 2.4.0-M2 development release. The latest stable release series is 3.0.x.

§Application global settings

§The Global object

Defining a Global object in your project allows you to handle global settings for your application. This object must be defined in the root package.

import play.*;

public class Global extends GlobalSettings {

}

§Intercepting application start-up and shutdown

You can override the onStart and onStop operation to be notified of the corresponding application lifecycle events:

import play.*;

public class Global extends GlobalSettings {

    public void onStart(Application app) {
        Logger.info("Application has started");
    }

    public void onStop(Application app) {
        Logger.info("Application shutdown...");
    }

}

Next: Intercepting requests