I am currently using Play.current in the following way.
import play.api.{Logger, Play}
object ApplicationConfig {
val app = Play.current
def getConfInt(key: String): Option[Int] = {
val result = app.configuration.getInt(key)
result
}
}
Since migrating to 2.5, I have a warning saying that it is deprecated with
"This is a static reference to application, use DI instead"
However, the doc doesn't exactly say how am I supposed to use DI instead.
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…