Interface ServletContextInitializer
- All Known Implementing Classes:
AbstractFilterRegistrationBean,DelegatingFilterProxyRegistrationBean,DispatcherServletRegistrationBean,DynamicRegistrationBean,FilterRegistrationBean,RegistrationBean,ServletEndpointRegistrar,ServletListenerRegistrationBean,ServletRegistrationBean
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface used to configure a Servlet 3.0+
context
programmatically. Unlike WebApplicationInitializer, classes that implement this
interface (and do not implement WebApplicationInitializer) will not be
detected by SpringServletContainerInitializer and hence will not be
automatically bootstrapped by the Servlet container.
This interface is designed to act in a similar way to
ServletContainerInitializer, but have a lifecycle that's managed by Spring and
not the Servlet container.
For configuration examples see WebApplicationInitializer.
- Since:
- 1.4.0
- Author:
- Phillip Webb
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidonStartup(ServletContext servletContext) Configure the givenServletContextwith any servlets, filters, listeners context-params and attributes necessary for initialization.
-
Method Details
-
onStartup
Configure the givenServletContextwith any servlets, filters, listeners context-params and attributes necessary for initialization.- Parameters:
servletContext- theServletContextto initialize- Throws:
ServletException- if any call against the givenServletContextthrows aServletException
-