Spring加载主配置文件
来源:互联网 发布:cmd执行java class文件 编辑:程序博客网 时间:2024/06/04 00:55
5.14.4 Convenient ApplicationContext
instantiation for web applications
You can create ApplicationContext
instances declaratively by using, for example, a ContextLoader
. Of course you can also create ApplicationContext
instances programmatically by using one of the ApplicationContext
implementations.
You can register an ApplicationContext
using the ContextLoaderListener
as follows:
<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>
The listener inspects the contextConfigLocation
parameter. If the parameter does not exist, the listener uses /WEB-INF/applicationContext.xml
as a default. When the parameter does exist, the listener separates the String by using predefined delimiters (comma, semicolon and whitespace) and uses the values as locations where application contexts will be searched. Ant-style path patterns are supported as well. Examples are /WEB-INF/*Context.xml
for all files with names ending with "Context.xml", residing in the "WEB-INF" directory, and /WEB-INF/**/*Context.xml
, for all such files in any subdirectory of "WEB-INF".
- Spring加载主配置文件
- Spring配置文件加载外部配置文件
- spring配置文件加载
- spring多配置文件加载
- spring 加载配置文件
- Spring配置文件加载流程
- spring加载xml配置文件
- spring加载配置文件
- spring 配置文件加载方式
- spring配置文件加载流程
- 自定义加载Spring配置文件
- spring classpath 加载配置文件
- Spring:加载xml配置文件
- spring加载properties配置文件
- Spring加载配置文件
- Spring动态加载配置文件
- spring 加载配置文件
- 【spring】动态加载配置文件
- HDU 1257 最少拦截系统(DP)
- iOS presentViewController方式跳转延迟
- YuvI420转Jpeg
- Python高级爬虫(四):动态加载页面的解决方案与爬虫代理
- no.1
- Spring加载主配置文件
- html5签名以及保存图片
- WPF 一个MVVM的简单例子
- 性能测试工具 nGrinder 项目剖析及二次开发
- JAVA 自定义注解在自动化测试中的使用
- 动态规划dp经典题目:最大连续子序列和
- Yuv 422转Jpeg
- gradle入门
- dubbo zookeeper