将play框架升级到2.4后,发生以下错误。我已阅读2.4中删除GlobalSettings的文档。但是如何重写下面的代码?
错误
Global.scala:44: value getControllerInstance is not a member of play.api.GlobalSettings
代码
override def getControllerInstance[A](controllerClass: Class[A]): A = {
val instance = controllerClass.getConstructors.find { c =>
val params = c.getParameterTypes
params.length == 1 && params(0) == classOf[RuntimeEnvironment[DemoUser]]
}.map {
_.asInstanceOf[Constructor[A]].newInstance(DemoRuntimeEnvironment)
}
instance.getOrElse(super.getControllerInstance(controllerClass))
}