【发布时间】:2011-02-02 01:48:13
【问题描述】:
我有一个这样的属性文件:
frame.server.dev=mark.is.cool
frame.server.test=chris.is.cool
frame.server.qa=mitch.is.cool
frame.server.prod=cory.is.cool
我需要根据环境注入正确的值。由于我们有一个要从一个环境移动到另一个环境的 ear 文件,因此我需要执行以下操作:
<util:properties id="props" location="classpath:ILog-application.properties"/>
然后:
@Value ("props.frame.server.#{systemProperties.the.environment}")
private String server;
但是,我不能让 systemProperties 工作,也不能让它在常量之后注入任何东西。有什么帮助吗?
【问题讨论】:
标签: java spring file properties