Reputation: 1437
What is the use of the ApplicationContext.xml file in Spring MVC. I did not get it. I tried to search on internet but no help.
Thanks
Upvotes: 0
Views: 1158
Reputation: 1397
Maybe you are refering to the Spring configuration file, where you configure metadata; this configuration metadata represents how you as an application developer tell the Spring container to instantiate, configure, and assemble the objects in your application. It can have another name and there can be more than one in your application.
Upvotes: 0
Reputation: 597382
applicationContext.xml
is used for the rest of the spring application, that is not web-related. The beans defined dispatcher-servlet.xml
are only web-related. Everything else (service layer, data access, etc), should not go there.
The relationship between the two xml files is that they define two different contexts. The one in applicationContext.xml
is parent, and the one in dispatcher-servlet.xml
is child . The child has access to the parent's beans.
Upvotes: 3