I have a webapp that uses SpringMVC DispatcherServlet to load a WebApplicationContext. The Spring reference documentation says:
“each DispatcherServlet has its own
WebApplicationContext, which inherits
all the beans already defined in the
root WebApplicationContext. These
inherited beans can be overridden in
the servlet-specific scope, and you
can define new scope-specific beans
local to a given servlet instance.
But where do I put this root WebApplicationContext?
We have
applicationContext.xmlin theWEB-INFdirectory, and the beans in that config are available to thespring-servlet.xmlconfig, its defined usingBy the way its the
ContextLoaderListenerwhich is responsible for managing the root context