Vaadin & Spring

Combine two world-class Java frameworks and build your applications the right way from the beginning. When your Vaadin user interface is managed by Spring, you have the entire Spring ecosystem at your fingertips.

 
Spring Webinar

See the recorded Spring & Vaadin Webinar.

Spring Vaadin Consulting

Contact our sales team at sales@vaadin.com

 
Front-end
Vaadin for Spring Applications

Build beautiful web user interfaces. With Vaadin you don't need to spend your budget on fighting with HTML and tuning pixels in CSS, but focus on your application logic.

Concentrate on single page applications. Vaadin is designed to take care of all of the RIA complexity so that you don't have to. From communication to browser quirks and rendering – all is handled by the framework.

Code in Java on the server-side. With a framework taking care of everything happening in the browser, there's no need to use e.g. JavaScript. Stay productive in server-side Java until you really have a need to tweak the low-level details.

Easy binding to Spring data sources. You can inject your existing services into any part of your UI component tree and easily bind the components to your data. Vaadin and Spring work together out of the box.

Backend
Spring for Vaadin Applications

You're ready to go in one step with Spring Boot. We have integrated Vaadin with Spring Boot so that you can get a fully configured environment, including a standalone server, with just a few clicks. You can start adding your content to the UI class right away.

Inversion of control for modularity and testability. The IoC container at the core of Spring libraries will help you write more modular software. The end result will be more reusable, maintainable and testable applications.

Cloud-ready applications. Code portability through decoupling and the rich toolbox of features in Spring make it easy to forklift applications from the local development environment into any web container and cloud platform.

The full set of Spring libraries available. Spring is not just about @Autowired and IoC. The really handy Spring libraries, like the awesome Spring Data, are helpful in typical Vaadin applications as well.

 
Get the best of both worlds.

Follow the documentation and tutorials, and check out the sample code to see how to use Vaadin and Spring to build web applications that last. It is easy to build the applications the right way.

Hello Spring and Vaadin 

While this is just a single file example, we have the basic ingredients: Vaadin UI and Spring Service. To build and run it, create an project using Spring Initializr (or just get a zip here) and create a class called DemoApplication.java

DemoApplication.java
@SpringBootApplication
public class DemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @Service
    public static class MyService {
        public String sayHi() {
            return "Hello Spring Initializr!";
        }

    }

    @Theme("valo")
    @SpringUI(path = "")
    public static class VaadinUI extends UI {

        @Autowired
        MyService myService;

        @Override
        protected void init(VaadinRequest request) {
            setContent(new Label(myService.sayHi()));
        }

    }
}