我開發了一個Spring/JPA應用程序:服務,存儲庫和域圖層即將完成。集成Play框架2.0和Spring框架
只有缺少的圖層是web圖層。我正在考慮爲網頁層使用Playframework 2.0,但我不確定我是否可以在我的Playframework 2.0類中注入/使用彈簧豆。
這可能嗎?如果是這樣如何?
我開發了一個Spring/JPA應用程序:服務,存儲庫和域圖層即將完成。集成Play框架2.0和Spring框架
只有缺少的圖層是web圖層。我正在考慮爲網頁層使用Playframework 2.0,但我不確定我是否可以在我的Playframework 2.0類中注入/使用彈簧豆。
這可能嗎?如果是這樣如何?
您可以。更新了播放2.5.X:
有already support在播放Spring IoC容器。這只是編輯鏈接到文章中提到的application.conf文件。
忽略上面的看到的評論:看起來這是在playframework 2.0中掉線的。
這是另一種使用Spring注入bean的方法。使用標準註釋。不需要插件。
Alex.p是正確的有彈簧支持PlayFramework
看看這裏: http://typesafe.com/blog/announcing-play-framework-21-the-high-velocit
,並在這裏例如: https://github.com/guillaumebort/play20-spring-demo
乾杯
我只是測試編輯它在我的項目上工作,但在2.0中的playframework 2.1它沒有工作。
請更新[鏈接](http://stackoverflow.com/editing-help#links)以增加清晰度 – artdanil 2013-05-14 21:11:29
順便說的例子嗎? – balteo 2012-03-16 15:57:17
@WillSargent第一個鏈接已經死亡。你能更新嗎? – 2015-01-01 06:50:47
這個插件將使用Spring 4與Play 2:https://github.com/scott-phillips/Spring4Play2 – Cuga 2015-08-11 14:03:38