Annotation Type EnableVaadin
-
@Target(TYPE) @Retention(RUNTIME) @Documented @Import({VaadinScopesConfig.class,VaadinServletConfiguration.class,VaadinScanPackagesRegistrar.class,VaadinApplicationConfiguration.class}) public @interface EnableVaadin
Brings in the machinery to setup Spring + Vaadin applications. This annotation should be added on aConfigurationclass of the application to automatically import Vaadin configuration (such asVaadinScopesConfig).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 @
Routeannotation).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
EnableVaadinannotation with package names to scan at startup as a value.- Author:
- Vaadin Ltd
- See Also:
- ServletContainerInitializers issue
-
-
Element Detail
-
value
String[] value
Base packages to scan for annotated classes on Vaadin startup.If packages are not specified then default Spring Boot application package is used.
- Returns:
- the base packages to scan
- Default:
- {}
-
-