Vaadin Spring Configuration

There are a number of properties that you can use to configure your Flow application. See e.g. com.vaadin.server.DeploymentConfiguration and com.vaadin.server.Constants classes for property names.

You can still set those properties as system properties. But you can also use Spring properties. The Spring configuration properties have the same names but they are prefixed with "vaadin.".

Spring Boot properties

If you use Spring Boot then you can use application.properties file for setting your properties.

E.g. if you want to set URL mapping (which is /* by default) you should put this line into you application.properties file.

ini

  1. vaadin.urlMapping=/my_mapping/*

Configuring Spring Web application

If you don’t use Spring Boot and you use VaadinMVCWebAppInitializer subclass then you should populate somehow your properties by yourself. You may create a configuration in the following way:

Java

  1. @Configuration
  2. @ComponentScan
  3. @PropertySource("classpath:application.properties")
  4. public class MyConfiguration {
  5. }

The application.properties file is used here as well but you may use any name and any property source here. Now you just need to set properties in the application.properties file in the same way as above.