user900721
user900721

Reputation: 1437

ApplicationContext file in Spring MVC

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

Answers (2)

Oscar
Oscar

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

Bozho
Bozho

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

Related Questions