Skip to main content

So close to a tweetable Springboot Vaadin application

Springboot allows you to run a Groovy script with nearly no ceremonial boilerplate code around it from command line (e.g. just annotate a Groovy class with @RestController). For quick GUI tests this would be great. Right now, sadly it needs alot boilerplate...

import org.vaadin.spring.annotation.VaadinUI
import com.vaadin.server.VaadinRequest
import com.vaadin.ui.*

class MyUI extends UI {
        protected void init(VaadinRequest request) {
                setContent(new Label("Hello World"))

Store as vaadin.groovy and run with spring run vaadin.groovy (or even with spring run vaadin.groovy --watch to make it reload automatically). Then navigate your browser to http://localhost:8080.

spring-boot-vaadin pulls in the autoconfiguration for Springboot. And the themes and client-compiled are needed for the theme and the widgetset. server is for having the proper versions (or else we get the transitive ones from the plugin)