问题描述:
Could not resolve placeholder 'out_put_path' in value "${out_put_path}"
翻译:无法解析值"${out_put_path}"中的占位符'out_put_path' 通过@Value注解无法解析占位符问题分析:
这是因为Spring采用反射扫描的发现机制,当检测到Spring容器中有一个PropertyPlaceholderConfigurer的Bean时,会停止对剩余的PropertyPlaceholderConfigurer的扫描,就是说当第一个PropertyPlaceholderConfigurer配置加载之后,后面出现的PropertyPlaceholderConfigurer将不会被加载。
解决方法
一、将配置信息放置在同一文件中加载
二、同时加载所有文件
<context:property-placeholder location="classpath:resource/*.properties" />