Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrating Play framework 2.0 and Spring framework

Tags:

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?

like image 778
balteo Avatar asked Mar 14 '12 14:03

balteo


People also ask

Is play better than spring?

Play is a direct competitor to Spring framework and designed to develop and deploy web applications more efficiently and also provides better MVC framework. In terms of getting a web application up and running quickly, play is the best.

Which framework does spring boot support?

Spring Boot is built on top of the Spring framework, and it comes with many dependencies that can be plugged into the Spring application. Some examples are Spring Kafka, Spring LDAP, Spring Web Services, and Spring Security.

What is the framework used by spring?

The Spring Framework is an open-source framework for building enterprise Java applications. Spring aims to simplify the complex and cumbersome enterprise Java application development process by offering a framework that includes technologies such as: Aspect-oriented programming (AOP) Dependency injection (DI)

Is Spring Framework still relevant?

Today, Java Spring Framework is still among the highly demanded frameworks in the Information Technology world. In 2021, Java Spring Developers used the framework to develop and deploy cloud-based microservices, including data processing applications, web applications, and many more.


2 Answers

You can. Updated for Play 2.5.x:

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

like image 79
Will Sargent Avatar answered Oct 26 '22 16:10

Will Sargent


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.

like image 36
hytrus Avatar answered Oct 26 '22 17:10

hytrus