java - spring框架如何加载context.xml文件
问题描述
这是 STS 创建的默认项目。
下面有xml代码
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd">
<annotation-driven />
<resources mapping="/resources/**" location="/resources/" />
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
<context:component-scan base-package="com.hee.heechart" /> -
</beans:beans>
我不明白.. springframework 如何加载 context.xml 文件
servlet-context.xml文件和root-context.xml文件效果很好,但是不知道加载root-context.xml文件和servlet-context.xml文件的springframework结构。
是否可以在 WEB-INF 文件夹中加载 appServlet 文件夹,因为它位于类路径中?
解决方案
推荐阅读
- python - SSL: CERTIFICATE_VERIFY_FAILED] 证书验证失败:无法获取本地颁发者证书 (_ssl.c:1076)')
- r - 如何在 TraMineR 中使用来自 BORIS 的状态数据?
- python - 如何区分使用 python 进行 CV2 图像处理中的行?
- python-3.x - 具有相同字符的对角线 - Python
- go - 未从 list.List 中删除元素
- java - spring boot jar 未连接到 Kafka 代理(通过系统变量 java.security.auth.login.config 设置 client_jaas.conf)
- python - 如果我将默认设置为无,我可以省略 Optional 吗?
- gatsby - 错误 #98123 WEBPACK 生成开发 JavaScript 包失败
- angular - Angular 类型脚本对象日志到控制台
- javascript - 在 catch 中发生错误后停止