Annotation Interface EnableVaadin
Configuration class of the
application to automatically import Vaadin configuration (such as
VaadinScopesConfig).
Use this annotation in your Spring Boot application to scan the packages with
Vaadin types that should be discovered at startup (e.g. routes
via @Route annotation).
You don't need this annotation if your application runs as a Web application
being deployed into a Web container. But if you run your application as a
Spring Boot application then classpath scanning is disabled due the Spring
Boot design (see ServletContainerInitializers
issue). Spring Vaadin add-on implements this scanning for you but it uses
the default application package for this (the package where you have your
Spring Boot application class). It means that if your Vaadin classes are
inside this package or its descendant subpackage then everything works out of
the box. Otherwise you should use EnableVaadin annotation with
package names to scan at startup as a value.
- Since:
- 10.0
- Author:
- Vaadin Ltd
- See Also:
-
Optional Element Summary
Optional Elements
-
Element Details
-
value
String[] valueBase packages to scan for annotated classes on Vaadin startup.If no annotation declares packages, the default Spring Boot application package is used.
The annotation can be added to several configuration classes. The packages of all of them are scanned. An annotation without packages adds no packages. If another annotation declares packages, the default application package is not scanned, so add it to the packages explicitly.
- Returns:
- the base packages to scan
- Default:
{}
-