【发布时间】:2015-07-14 07:59:08
【问题描述】:
我的 Spring MVC Webapp 有以下配置。我想从概念上知道 servlet-context.xml 中的 contextConfigLocation (它是 appServlet 的 conf)和其他文件的安全性、瓷砖...我不明白它是如何工作的,因为如果我把我在 servlet-context 中的 tiles-context.xml 配置应用程序可以工作,在其他情况下没有,但安全性工作正常。此文件中的 Bean 也不在 appServlet 容器中吗?是否有多个上下文?
<!-- DispatcherServlet Conf - Processes application requests -->
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:servlet-context.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<!-- Spring configuration files in XML -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:security-context.xml
classpath:tiles-context.xml
...
</param-value>
</context-param>
【问题讨论】:
-
你可以看看这个链接stackoverflow.com/questions/16860016/….similar question
标签: java spring configuration web.xml