Blog

Vaadin available at start.spring.io

By  
Sami Ekblad
Sami Ekblad
·
On Apr 7, 2015 11:00:00 AM
·

Spring Initializr is a project configurator that you can use to kickstart your application project. You can use it directly from the web page, but there are also IDE integrations, Spring Boot CLI or simply command line curl to get started. You can just check the libraries and e.g. DB that you are going to use, choose the Java version and build system and then download a project stub as a zip file. You could think Spring Initializr kind of as an archetype on steroids.

 

Those using it often might have already seen a new option available for Vaadin. In practice this option adds Vaadin Spring dependencies to your project so you have a good starting point for your the Vaadin Spring Boot applications.

Generate a project right from the command line:

curl https://start.spring.io/starter.zip -d dependencies=vaadin -d baseDir=vaadin-demo -o vaadin-demo.zip
And here is a brief example of a service and Vaadin UI class for you to start with:
@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()));
       }
   }

}

source at GitHub »

Along the way, we have updated our Spring tutorial as well to use the Spring Initializr to kickstart the application project.


Read more at vaadin.com/wiki

Sami Ekblad
Sami Ekblad
Sami Ekblad is one of the original members of the Vaadin team. As a DX lead he is now working as a developer advocate, to help people the most out of Vaadin tools. You can find many add-ons and code samples to help you get started with Vaadin. Follow at – @samiekblad
Other posts by Sami Ekblad