集成Play framework 2.0和Spring框架
我开发了一个Spring / JPA应用程序: 服务,存储库和域层即将完成 。
唯一缺少的是Web图层 。 我正在考虑将Playframework 2.0用于Web层,但我不确定是否可以在Playframework 2.0类中注入/使用spring bean 。
这可能吗? 如果是这样的话?
您可以。 已针对Play 2.5.x进行了更新:
Alex.p是正确的,PlayFramework支持spring
看看这里: http : //typesafe.com/blog/announcing-play-framework-21-the-high-velocit
在这里的例子: https : //github.com/guillaumebort/play20-spring-demo
干杯
我刚刚在我的项目上测试它,但是在2.0中的playframework 2.1上它没有用。
这是使用Spring注入bean的另一种方法。 使用标准注释。 不需要插件。
请参阅http://spring-webservice-2-step-by-step.blogspot.in/2013/12/spring-framework-integration-with-play.html
这是弹簧游戏集成的一个例子
Play中已经支持 Spring IoC容器。 只需编辑链接到文章中提到的application.conf文件即可。
忽略上面看到的评论:似乎这在playframework 2.0中被删除了。