Performs the actual initialization work for the root application context. Called by {@link ContextLoaderListener}.
Looks for a {@link #CONTEXT_CLASS_PARAM "contextClass"} parameterat the web.xml
context-param level to specify the context class type, falling back to the default of {@link org.springframework.web.context.support.XmlWebApplicationContext}if not found. With the default ContextLoader implementation, any context class specified needs to implement the ConfigurableWebApplicationContext interface.
Processes a {@link #CONFIG_LOCATION_PARAM "contextConfigLocation"}context-param and passes its value to the context instance, parsing it into potentially multiple file paths which can be separated by any number of commas and spaces, e.g. "WEB-INF/applicationContext1.xml, WEB-INF/applicationContext2.xml". Ant-style path patterns are supported as well, e.g. "WEB-INF/*Context.xml,WEB-INF/spring*.xml" or "WEB-INF/**/*Context.xml". If not explicitly specified, the context implementation is supposed to use a default location (with XmlWebApplicationContext: "/WEB-INF/applicationContext.xml").
Note: In case of multiple config locations, later bean definitions will override ones defined in previously loaded files, at least when using one of Spring's default ApplicationContext implementations. This can be leveraged to deliberately override certain bean definitions via an extra XML file.
Above and beyond loading the root application context, this class can optionally load or obtain and hook up a shared parent context to the root application context. See the {@link #loadParentContext(ServletContext)} method for more information.
As of Spring 3.1, {@code ContextLoader} supports injecting the root webapplication context via the {@link #ContextLoader(WebApplicationContext)}constructor, allowing for programmatic configuration in Servlet 3.0+ environments. See {@link org.springframework.web.WebApplicationInitializer} for usage examples.
@author Juergen Hoeller
@author Colin Sampaleanu
@author Sam Brannen
@since 17.02.2003
@see ContextLoaderListener
@see ConfigurableWebApplicationContext
@see org.springframework.web.context.support.XmlWebApplicationContext