Spring can't see beans between servlet-context and contextConfigLocation beans
Yes there are two contexts stacked on each other (parent and child context).
The beans from the DispatcherServlet (servlet-context.xml
) can access the beans from the ContextLoaderListener (configuration-context.xml
), but not the other way around.
So put the basic stuff in the configuration-context.xml
and the web related once into servlet-context.xml
.
@See also this Stack Overflow question: ContextLoaderListener or not?