The documentation at https://www.playframework.com/documentation/2.4.x/JavaDependencyInjection mentions that DI is now integrated into the structure:
The Play field provides support for dependency injection based on JSR 330. By default, the JSR 330 implementation that ships with Play, Guice, but other JSR 330 implementations can be connected.
I could not find a HOWTO or a working example that uses Spring.
Current documentation at https://www.playframework.com/documentation/2.4.x/Tutorials refers to the example “Play with Spring Data JPA” at https://typesafe.com/activator/template/play- spring -data-jpa but the comments already mention that it is out of date. In addition, on the GitHub page https://github.com/typesafehub/play-spring-data-jpa there are open problems with the mention that it does not work in Play 2.4.0.
The code is 2 years old and still uses the Global.java class to load Spring. I would be fine, but the code no longer compiles in Play 2.4 due to the getControllerInstance () method.
This https://github.com/jroper/play- spring project looks promising, but it is in Scala, and there are many TODOs listed, and the SpringApplicationLoader class is in https://github.com/jroper/play-spring/blob /master/core/src/main/scala/play/api/inject/spring/SpringApplicationLoader.scala looks too complicated when all I want to do is run a simple Spring context.
Now it seems that I need to downgrade Play to use the old Global.java hack (and find out all the necessary changes ...)
(some pls editors returned the links, they are legal, this did not allow me ...)
source share