spring <context:property-placeholder/> 配置详解
来源:互联网 发布:js arguments 回调函数 编辑:程序博客网 时间:2024/05/21 19:22
<context:property-placeholder/>
${key}占位符属性替换器,配置如下:
[html] viewplain copy
- <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属性
- 正则表达式语法简介
- linux查找目录下的所有文件中是否含有某个字符串
- Android模仿通讯录
- C++11特性:auto关键字与基于范围的for循环
- spring框架创建helloworld
- spring <context:property-placeholder/> 配置详解
- 用Xshell部署javaweb项目
- Delphi启动/停止Windows服务,启动类型修改为"自动"
- Ionic2系列——Ionic 2 Guide 官方文档中文版
- SiteMesh简介
- Oracle 12C 创建用户连接pdb
- 字符串全排列算法
- 大数据量下MySQL插入方法的性能比较
- java内部类详解