spirng通过@value获取配置文件的值
一:在配置文件aplicationContext-service添加:
|
<context:property-placeholder location="classpath:path.properties" ignore-unresolvable="true" file-encoding="UTF-8" />
|
二:编写配置文件
三:注解获取配置文件的值
@Value("${basePath}")
private String basePath;
浙公网安备 33010602011771号