open fun onStartup(@Nullable webAppInitializerClasses: MutableSet<Class<*>>, servletContext: ServletContext): Unit
Delegate the ServletContext to any WebApplicationInitializer implementations present on the application classpath.
Because this class declares @HandlesTypes(WebApplicationInitializer.class), Servlet 3.0+ containers will automatically scan the classpath for implementations of Spring's WebApplicationInitializer interface and provide the set of all such types to the webAppInitializerClasses parameter of this method.
If no WebApplicationInitializer implementations are found on the classpath, this method is effectively a no-op. An INFO-level log message will be issued notifying the user that the ServletContainerInitializer has indeed been invoked but that no WebApplicationInitializer implementations were found.
Assuming that one or more WebApplicationInitializer types are detected, they will be instantiated (and sorted if the @ annotation is present or the org.springframework.core.Ordered interface has been implemented). Then the WebApplicationInitializer#onStartup(ServletContext) method will be invoked on each instance, delegating the ServletContext such that each instance may register and configure servlets such as Spring's DispatcherServlet, listeners such as Spring's ContextLoaderListener, or any other Servlet API componentry such as filters.
webAppInitializerClasses - all implementations of WebApplicationInitializer found on the application classpath
servletContext - the servlet context to be initialized
See Also
WebApplicationInitializer#onStartup(ServletContext)AnnotationAwareOrderComparator