Ein Blog

Gesammelte Notizen

Spring Boot and Vaadin with Maven - Start

08 Januar, 2016 | Java

For the data collected by the service described here we want to have a nice GUI to view it.

In this post I'll use Spring Boot and Vaadin to create a simple UI.
This post is inspired by the Vaadin Getting Started with Vaadin Spring and Spring Boot tutorial.

For a quick start you can use Spring Initializr to bootstrap the application. Just change the group and artifact names and use the search field to add the Vaadin dependency. You can also switch to the full version and choose Vaadin in the web section of the form.
Then press the the 'Generate' button to download the project. You might have to updated the Vaadin version in the generated pom file.

Now open the downloaded project and open it in your favorite IDE.

A Vaadin user interface starts with a UI class.

public class SensorFrontendUI extends UI { @Override protected void init(VaadinRequest vaadinRequest) { setContent(new Label("Hello! I'm the root UI!")); } }

To do this, create a new class that extends from the Vaadin UI class and add the @SpringUI annotation.

Using maven run you can start the application and you can open it at http://localhost:8080.

But right now the application looks quite empty, so let's add some content in the next post.

The source code of the complete project is here.

Related posts:

Views and Navigation

Using Add Ons

Packaging and setting production mode

Vaadin behind Apache Web Server using Virtual Directory