Sprint加载properties文件内容相关配置。
来源:互联网 发布:网络遭遇撞库攻击 编辑:程序博客网 时间:2024/05/16 14:32
properties文件路径:config/properties/test.properties
内容:
test.id=123
test.name=测试
XML配置文件:
<?xml version="1.0" encoding="uTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>config/properties/test.properties</value><!-- 加载队列配置文档 -->
</list>
</property>
</bean>
<bean class="com.test.entity.Test">
<property name="id" >
<value>${test.id}</value>
</property>
<property name="name" >
<value>${test.name}</value>
</property>
</bean>
Test类:
public class Test{
public static String id;
public static String name;
//get set方法...
}
- Sprint加载properties文件内容相关配置。
- properties文件的配置加载
- MySQL连接Hibernate配置properties文件内容
- 读取properties文件的内容配置数据库
- Java读取Properties文件 Java加载配置Properties文件
- SpringMvc 加载配置.Properties文件中的方法
- spring 如何动态加载properties文件的内容
- spring 如何动态加载properties文件的内容
- 读取properties文件内容
- 解析properties文件内容
- log4j.properties 文件内容
- 取得properties 文件内容
- properties文件读取内容
- spring 加载 properties文件
- java 加载properties 文件
- java 加载properties 文件
- java加载properties文件
- Java 加载Properties文件
- Linux的环境变量
- IE 禁用缓冲
- 常见验证码的弱点与验证码识别
- Web前端开发【html+css+javascript+Dom+jQuery】问题笔记
- 使qt编译不输出警告信息
- Sprint加载properties文件内容相关配置。
- git中无法丢弃某个文件的修改 也无法删除该文件
- winform模拟asp.net的表单上传文件
- java 大数
- Linux/Unix----线程安全和可重入
- 服务器共享文件夹后,客户端出现“您可能没有权限使用网络资源”提示的解决办法
- android面试遇到的一些经典题
- 用json实现服务器servlet和安卓客户端的数据交互
- 开工啦