Close
Back

Spring Time for Vaadin



Originally, the idea of the webinar was to show you how Spring has been used in different Vaadin projects in the past. However, once Josh Long from Pivotal got involved, we ended up creating a first prototype of a completely new integration that will sweep the floor with the conventional ways. This changed the webinar quite a bit.

In the past, there were basically two ways of integrating Vaadin and Spring if you did not want to or could not use any third-party addons. The first approach was to create a custom Vaadin UI provider that fetches the UI-instances from a Spring web application context and plugging it into the Vaadin servlet. This is quite easy to set up, but it limits you to the prototype scope and causes problems if your UI needs to be serializable.

The second approach was to use AspectJ to inject references into your Vaadin UI components. This approach does not require any custom servlets or UI providers, it works with serialization and can be used with existing Vaadin applications that have been created without Spring in mind. However, you need to use the AspectJ compiler and an IDE that supports AspectJ.

The examples from the webinar can be found here: https://github.com/peholmst/vaadin-spring-webinar

In the future, you will be able to seamlessly add a Vaadin UI to your Spring application with the help of Spring Boot. Just make sure you have the right JARs in your classpath and start coding Vaadin user interfaces. No need for any XML files or custom servlets. No scoping problems. Seamless integration with Spring Security.

The new integration add-on that's cooking can be found here: https://github.com/peholmst/vaadin4spring

Officially it is still only an R&D prototype, meaning that although Vaadin is participating in the development, it is not yet an official Vaadin product and thus is not officially supported. The plan is, however, to fork it into an official add-on once the API and features have become stable enough.

Petter HolmströmPetter Holmström likes to play with software architecture stuff. He also likes to put out fires, both in software projects and for real. You can follow him on Twitter, although he isn't currently that active – @petterholmstrom

Comments
Here is an example of the integration of "Spring" with "Vaadin7" to implement the design pattern "MVP". The article is in french but you can look at the source code available for download.

http://www.iptech-group.com/blog/mvp-avec-vaadin-7-et-spring#.UvzHrfl5PXo
Posted on 2/13/14 1:25 PM.
Is there a sample project without Spring Boot?
Posted on 2/13/14 4:02 PM.
I'd like to thank you for the webinar. I learned a lot from it and got a lot of information from it. I was struggling with integrating Spring with Vaadin and the presentation was a great help. Looking forward to the work being done now.
Posted on 2/13/14 5:51 PM.
This has great potential for the many Java/Spring developers out there. I look forward to seeing it mature. Now if only Vaadin 7 and CORS or Cross-Site embedding would work...
Posted on 2/14/14 6:38 AM.
Not yet, but we will provide one at some point.
Posted on 2/24/14 9:18 AM in reply to Vladimir Kulev.
I'm a beginer, i don't understand somethings, for example UIPROVIDER, ..... there is a more simple example to implement Vaadin + Spring?
Posted on 4/20/14 12:43 AM in reply to Petter Holmström.
Does Vaadin4Spring also support portlet development Liferay?
Posted on 5/8/14 7:43 PM.
Currently it does not. Maybe in the future.
Posted on 5/23/14 7:19 AM in reply to Gordon Augat.
I notice that the Spring integration is built around Spring 4. I am guessing that there are a lot of Spring 3 applications that could benefit from this work (including mine!). Is it possible to include Spring 3 comparability?
Posted on 6/1/14 10:41 PM.