接口 ServletContextInitializer
- 所有已知实现类:
DelegatingFilterProxyRegistrationBean
,FilterRegistrationBean
,InitParameterConfiguringServletContextInitializer
,RegistrationBean
,ServletListenerRegistrationBean
,ServletRegistrationBean
public interface ServletContextInitializer
Interface used to configure a Servlet 3.0+context
programmatically. UnlikeWebApplicationInitializer
, classes that implement this interface (and do not implementWebApplicationInitializer
) will not be detected bySpringServletContainerInitializer
and hence will not be automatically bootstrapped by the Servlet container.This interface is primarily designed to allow
ServletContextInitializer
s to be managed by Spring and not the Servlet container.For configuration examples see
WebApplicationInitializer
.- 从以下版本开始:
- 1.4.0
- 另请参阅:
WebApplicationInitializer
方法详细资料
onStartup
void onStartup(javax.servlet.ServletContext servletContext) throws javax.servlet.ServletException
Configure the givenServletContext
with any servlets, filters, listeners context-params and attributes necessary for initialization.- 参数:
servletContext
- theServletContext
to initialize- 抛出:
javax.servlet.ServletException
- if any call against the givenServletContext
throws aServletException