如果我們以編程方式創建ApplicationContext
實例,很容易知道已創建了多少上下文。但是,如果我們使用ContextLoaderListener
,會創建多少個上下文?例如Spring的reference如下:由ContextLoaderListener創建的Spring上下文的數量
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/daoContext.xml /WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
它有2個上下文xml文件。這是否意味着創建了2個上下文?
謝謝。