Is there a way to specify Wildcard character like '*' to match anything. For Eg: I want to specify the configuration like this in application.conf.
application.*.config = value1
In the application I want this "value1" to get picked up for any of the below keys I specify.
application.test.config
application.prod.config
application.staging.config
How can I achieve this?
No there is not, you have two solutions
You can use application modes ( Dev , Prod or Test ) ie like this:
application { Dev.value = "My value for DEV" Prod.value = "My value for PROD" Test.value = "My value for TEST" } // controller String myValue = Play.application().configuration().getString("application." + Play.application().getWrappedApplication().mode().toString() + ".config");
You can create 3 alternative configs for your states and override ONE param ie application.config
, of course you will need to specify required alt. config file while running in given mode.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.