开发者

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.

开发者_JAVA技巧

Thanks


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜