Mar 3rd, 2013, 06:13 PM
XML file processing confusion
Trying to put an MVC project together and using the latest STS plugin to Eclipse, I thought that I could put the <context:component-scan> (also <context:annotation-config>) statements in the servlet-context.xml file that corresponds to the particular servlet that would use DI for a bean. But it never found the bean to inject.
When I moved the statements to the root-context.xml file then it found the bean and injected it as expected.
Now I've also seen 'app-context.xml' for a Hibernate utility project put into the META-INF/spring directory which contains DB-related info.
So what I'm looking for is a definition of the order of processing of XML files to resolve DI issues as well as the difference of such files as app-context.xml vs. root-context.xml.
I've read through section 4 of the Spring framework docs, but didn't see anything to address these questions.
All help appreciated.