For a web application then that is fairly normal - although the naming convention for the two files is often dispatcher-servlet.xml
and applicationContext.xml
.
The dispatcher-servlet.xml
(or mvc-config.xml
as in your question) is the configuration file for the web application context and contains the web specific beans and configuration for Spring MVC. It is loaded by the DispatcherServlet
when the application starts up.
The applicationContext.xml
(or application-config.xml
as in your question) is the configuration file for the main Spring application context and contains the non-web business beans (typically services, DAOs etc). This file is often spilt into fragments - with a fragment containing the beans for each logical layer within the app. This file is typically loaded by the ContextLoaderListener
defined in the web.xml
.
Spring automatically sets the main application context as the parent of the web application context. This ensures that web components (such as controllers) have access to business beans in the application context. However, business beans are not able to see beans in the web application context.