Integrating Play framework 2.0 and Spring framework

17,568

Solution 1

You can. Updated for Play 2.5.x:

https://github.com/remithieblin/play-spring-loader

Solution 2

Alex.p is right there is support for spring in PlayFramework

Have a look here : http://typesafe.com/blog/announcing-play-framework-21-the-high-velocit

and on example here : https://github.com/guillaumebort/play20-spring-demo

Cheers

I just tested it on my project it works but on playframework 2.1 in 2.0 it didn't work.

Solution 3

Here is a another way of injecting beans using Spring. Standard annotations are used. No plugin is required.

https://github.com/huntc/play-spring

Share:
17,568
balteo
Author by

balteo

Updated on June 03, 2022

Comments

  • balteo
    balteo about 2 years

    I have developed a Spring/JPA application: the service, repository and domain layers are nearing completion.

    The only layer that is missing is the web layer. I am considering using Playframework 2.0 for the web layer but I am not sure whether I can inject/use spring beans in my Playframework 2.0 classes.

    Is this possible? If so how?

  • balteo
    balteo over 12 years
    By the way how do I install this/a plugin onto Play?
  • balteo
    balteo over 12 years
    It seems that this was dropped in playframework 2.0. The link you provided is only relevant to version 1.x
  • alex.p
    alex.p over 12 years
    Ah I did not know that +1. Guessing it was because it was rewritten in Scala - couldn't find much info about it being dropped though. Do you know if they have any plans of reincorporating it or not? Spring Integration with Play sounds really good.
  • artdanil
    artdanil about 11 years
    Please update the links to add clarity
  • Cuga
    Cuga almost 9 years
    This plugin will use Spring 4 with Play 2: github.com/scott-phillips/Spring4Play2