Documentation

§Application global settings

§The Global object

Defining a Global class in your project allows you to handle global settings for your application:

import play.*;

public class Global extends GlobalSettings {

}

By default, this object is defined in the root package, but you can define it wherever you want and then configure it in your application.conf using application.global property.

§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


Dokümantasyonun bu çevirisi Play ekibi tarafından yapılmamaktadır. Eğer bir hata bulduysanız, bu sayfanın kaynak kodu burada bulunmaktadır. Dokümantasyon yönergelerini okuduktan sonra lütfen katkı yapmaktan çekinmeyin.