1、创建需要读取的properties文件
2、在xml文件中加载配置文件
<!-- 加载配置文件 --> <context:property-placeholder location="classpath:conf/resource.properties" />
3、使用@Value注解调用该属性
1、创建需要读取的properties文件
2、在xml文件中加载配置文件
<!-- 加载配置文件 --> <context:property-placeholder location="classpath:conf/resource.properties" />
3、使用@Value注解调用该属性
转载于:https://www.cnblogs.com/rgever/p/10354682.html