How to read properties on Play Framework

Play framework recommends you use their default properties file for that, so make sure you add your properties to the conf/application.conf file.

To read the property:


// Do not import the play.api.* it is a total different class

import play.Configuration;
import play.Play;

//on your method:

Configuration conf = Play.application().configuration();

conf.getString("your.property");

 

Thank you!

Advertisements

One thought on “How to read properties on Play Framework”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s