spring <context:property-placeholder/> 配置详解
来源:互联网 发布:淘宝买小米平板 编辑:程序博客网 时间:2024/05/21 22:30
<context:property-placeholder location="属性文件,多个之间逗号分隔" file-encoding="文件编码" ignore-resource-not-found="是否忽略找不到的属性文件" ignore-unresolvable="是否忽略解析不到的属性,如果不忽略,找不到将抛出异常" properties-ref="本地Properties配置" local-override="是否本地覆盖模式,即如果true,那么properties-ref的属性将覆盖location加载的属性,否则相反" system-properties-mode="系统属性模式,默认ENVIRONMENT(表示先找ENVIRONMENT,再找properties-ref/location的),NEVER:表示永远不用ENVIRONMENT的,OVERRIDE类似于ENVIRONMENT" order="顺序" />
location:表示属性文件位置,多个之间通过如逗号/分号等分隔;
file-encoding:文件编码;
ignore-resource-not-found:如果属性文件找不到,是否忽略,默认false,即不忽略,找不到将抛出异常
ignore-unresolvable:是否忽略解析不到的属性,如果不忽略,找不到将抛出异常
properties-ref:本地Java.util.Properties配置
local-override:是否本地覆盖模式,即如果true,那么properties-ref的属性将覆盖location加载的属性
system-properties-mode:系统属性模式,ENVIRONMENT(默认),NEVER,OVERRIDE
ENVIRONMENT:将使用spring 3.1提供的PropertySourcesPlaceholderConfigurer,其他情况使用Spring 3.1之前的PropertyPlaceholderConfigurer
如果是本地覆盖模式:那么查找顺序是:properties-ref、location、environment,否则正好反过来;
OVERRIDE: PropertyPlaceholderConfigurer使用,因为在spring 3.1之前版本是没有Enviroment的,所以OVERRIDE是spring 3.1之前版本的Environment
如果是本地覆盖模式:那么查找顺序是:properties-ref、location、System.getProperty(),System.getenv(),否则正好反过来;
NEVER:只查找properties-ref、location;
order:当配置多个<context:property-placeholder/>查找顺序;
- spring <context:property-placeholder/> 配置详解
- spring <context:property-placeholder/> 配置详解
- spring <context:property-placeholder/> 配置详解
- spring <context:property-placeholder/> 配置详解
- Spring配置<context:property-placeholder>标签解析
- spring 配置<context:property-placeholder/> 作用
- spring中context:property-placeholder
- Spring properties context:property-placeholder
- spring 标签:context:property-placeholder
- spring <context:property-placeholder>使用说明
- spring中context:property-placeholder/
- Spring配置文件<context:property-placeholder>
- spring配置文件<context:property-placeholder>
- Spring配置:用context:property-placeholder替换PropertyPlaceholderConfigurer
- Spring配置:用context:property-placeholder替换PropertyPlaceholderConfigurer
- spring配置文件中的context:property-placeholder属性
- spring中context:property-placeholder/元素
- spring配置文件中的context:property-placeholder属性
- 组播及igmp协议详解
- 【linux】 vmware安装无法打开内核设备 \\.\Global\vmx86: 系统找不到指定的文件
- git提交android项目时出现的问题
- SpringCloud配置加载流程
- leetcode Roman to Integer(Java)
- spring <context:property-placeholder/> 配置详解
- 估颜值算法及数据库
- 四、JNDI
- 虚拟机可ping通主机,主机无法ping通虚拟机
- [Linux][kernel]CFS调度策略
- 计算机网络原理
- 排序与查找实例(六):计数排序
- Maven全局配置文件settings.xml详解
- find 根据时间查找,详解