org.springframework.web.context
public class: ContextLoaderListener [javadoc |
source]
java.lang.Object
org.springframework.web.context.ContextLoaderListener
All Implemented Interfaces:
ServletContextListener
Bootstrap listener to start up Spring's root
WebApplicationContext .
Simply delegates to
ContextLoader .
This listener should be registered after
org.springframework.web.util.Log4jConfigListener
in web.xml, if the latter is used.
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.springframework.web.context.ContextLoaderListener Detail: |
public void contextDestroyed(ServletContextEvent event) {
if (this.contextLoader != null) {
this.contextLoader.closeWebApplicationContext(event.getServletContext());
}
}
Close the root web application context. |
public void contextInitialized(ServletContextEvent event) {
this.contextLoader = createContextLoader();
this.contextLoader.initWebApplicationContext(event.getServletContext());
}
Initialize the root web application context. |
protected ContextLoader createContextLoader() {
return new ContextLoader();
}
Create the ContextLoader to use. Can be overridden in subclasses. |
public ContextLoader getContextLoader() {
return this.contextLoader;
}
Return the ContextLoader used by this listener. |