Playframework 2
在application.conf添加项:
application.secret=mySecret
package util
import com.typesafe.config.ConfigFactory
object MyConfigUtil{
def getApplicationValueByKey(key:String): String ={
ConfigFactory.load().getString(key)
}
def main(args: Array[String]) {
println(getApplicationValueByKey("application.secret"))
}
}