open class ContextLoaderListener : ContextLoader, ServletContextListener
Bootstrap listener to start up and shut down Spring's root WebApplicationContext. Simply delegates to ContextLoader as well as to ContextCleanupListener.
As of Spring 3.1, ContextLoaderListener
supports injecting the root web application context via the #ContextLoaderListener(WebApplicationContext)
constructor, allowing for programmatic configuration in Servlet 3.0+ environments. See org.springframework.web.WebApplicationInitializer for usage examples.
Author
Juergen Hoeller
Author
Chris Beams
Since
17.02.2003
See Also
#setContextInitializersorg.springframework.web.WebApplicationInitializer
ContextLoaderListener()
Create a new This constructor is typically used when declaring The created application context will be registered into the ServletContext under the attribute name ContextLoaderListener(context: WebApplicationContext)
Create a new The context may or may not yet be . If it (a) is an implementation of ConfigurableWebApplicationContext and (b) has not already been refreshed (the recommended approach), then the following will occur:
ConfigurableWebApplicationContext , none of the above will occur under the assumption that the user has performed these actions (or not) per his or her specific needs.
See org.springframework.web.WebApplicationInitializer for usage examples. In any case, the given application context will be registered into the ServletContext under the attribute name |
open fun contextDestroyed(event: ServletContextEvent): Unit
Close the root web application context. |
|
open fun contextInitialized(event: ServletContextEvent): Unit
Initialize the root web application context. |