You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.flow.spring.

Class VaadinServletContextInitializer

java.lang.Object
com.vaadin.flow.spring.VaadinServletContextInitializer

All Implemented Interfaces:

org.springframework.boot.web.servlet.ServletContextInitializer

public class VaadinServletContextInitializer extends Object implements org.springframework.boot.web.servlet.ServletContextInitializer

Servlet context initializer for Spring Boot Application.

If Java application is used to run Spring Boot then it doesn't run registered ServletContainerInitializers (e.g. to scan for Route annotations in the classpath). This class enables this scanning via Spring so that the functionality which relies on ServletContainerInitializer works in the same way as in deployable WAR file.

See Also:

  • Constructor Details

    • VaadinServletContextInitializer

      public VaadinServletContextInitializer(org.springframework.context.ApplicationContext context)

      Creates a new ServletContextInitializer instance with application context provided.

      Parameters:

      context - the application context

  • Method Details

    • onStartup

      public void onStartup(jakarta.servlet.ServletContext servletContext) throws jakarta.servlet.ServletException

      Specified by:

      onStartup in interface org.springframework.boot.web.servlet.ServletContextInitializer

      Throws:

      jakarta.servlet.ServletException