在application.conf中,我添加了以下属性
property1="value1"
property2="prefix ${property1}"
在任何控制器中我添加了以下代码
println(Play.application.configuration.underlying.getString("property1"))
println(Play.application.configuration.underlying.getString("property2"))
println(Play.application.configuration.getString("property1"))
println(Play.application.configuration.getString("property2"))
输出
value1
prefix ${property1}
Some(value1)
Some(prefix ${property1})
答案 0 :(得分:1)