配置可以读取属性:
<beans profile="idc">
<context:property-placeholder ignore-resource-not-found="true"<span style="color: #000000;">
location</span>="classpath:/<a href="/tag/Meta/" target="_blank" class="keywords">Meta</a>-INF/config/idc/*.properties" />
</beans>
<beans profile="production">
<context:property-placeholder ignore-resource-not-found="true"<span style="color: #000000;">
location</span>="classpath:/<a href="/tag/Meta/" target="_blank" class="keywords">Meta</a>-INF/config/prod/*.properties" />
</beans>
<beans profile="test">
<context:property-placeholder ignore-resource-not-found="true"<span style="color: #000000;">
location</span>="classpath:/<a href="/tag/Meta/" target="_blank" class="keywords">Meta</a>-INF/config/test/*.properties" />
</beans></pre>
Resource resource = ClassPathResource("/my.properties"= PropertiesLoaderUtils.loadProperties(resource);
参考文献:
【1】http://stackoverflow.com/questions/1771166/access-properties-file-programatically-with-spring