spirng通过@value获取配置文件的值
一:在配置文件aplicationContext-service添加:
<context:property-placeholder location="classpath:path.properties" ignore-unresolvable="true" file-encoding="UTF-8" />
|
二:编写配置文件
![](https://images2015.cnblogs.com/blog/1144525/201704/1144525-20170413163425970-709421239.png)
三:注解获取配置文件的值
@Value("${basePath}")
private String basePath;