1

I am working on a Spring application. I started from creating a small java app using spring. Later, it became necessary to add a web interface. I decided to use Spring MVC. Now I am confused. In my web.xml I have

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/mvc-dispatcher-servlet.xml,
        /WEB-INF/applicationContext.xml
    </param-value>
</context-param>

where mvc-dispacher-servlet.xml contains beans necessary for web logic while applicationContext.xml contains beans performing some specific operations. My question is: Are beans in these files going to be aware of each other? Is it going to be a one big container which includes beans from both config files? or these containers are separate?

4

1 回答 1

1

是的,它将在一个从 Web 应用程序上下文加载的上下文中。它与使用应用程序上下文并向其传递多个文件时所做的相同。

于 2013-04-18T09:34:27.010 回答