I want to use the getInstance
method of the Guice Injector
class in Play Framework 2.4, how can I access it?
I have used the Guice Fa
With Play Framework 2.5.x play.api.Play.current
is deprecated and DI should always be preferred. Therefore proper way of getting injector instance is by using:
import play.api.inject.Injector
import javax.inject.Inject
class SomeClassRequiringInjector @Inject() (injector: Injector) { ... }
Works for me even when doing this with DI Provider class :)