applicationContext.xml和spring-servlet.xml在Spring框架无论如何有关系吗?applicationContext.xml是否可用DispatcherServlet?*-servlet.xml?为什么applicationContext.xml单独不足?应用程序上下文和Web应用程序上下文有什么区别?
我知道WebApplicationContext用于面向Spring MVC架构的应用程序?
我想知道ApplicationContextMVC应用程序有什么用?什么样的豆类定义ApplicationContext?
来自XmlWebApplicationContext javadoc:
默认情况下,配置将从"/WEB-INF/applicationContext.xml"获取根上下文,而"/WEB-INF/test-servlet.xml"获取具有命名空间"test-servlet"的上下文(如对于具有servlet-name"test"的DispatcherServlet实例.
Spring语境是什么意思?
什么是根背景?还有哪些其他类型的Spring上下文?
什么是命名空间?
更新:
一些后续问题:
什么是Spring ApplicationContext - 它是否包含在配置XML文件中定义的bean?
查看ContextLoaderListener的代码,看起来它加载了配置XML文件中定义的数据.但我的Spring Web应用程序无需定义此侦听器或任何其他侦听器.怎么会这样?
在什么情况下有多个Spring的DispatcherServlet实例是有意义的?
根上下文(来自applicationContext.xml的数据)是否适用于DispatcherServlet的每个实例,而其他上下文(例如来自test-servlet.xml的数据)仅适用于相关的DispatcherServlet(即测试)?
我一直在学习Spring,JSP和servlets.我不理解上下文根的概念.有这么多.SpringContext根,servlet上下文根,可能还有其他.
在Spring MVC应用程序中,有多少上下文根以及如何识别它们?他们真正的意思是什么?