【发布时间】:2012-05-16 13:38:35
【问题描述】:
我想在 spring xml 配置中使用我的应用程序常量。
我知道用 spring SpEl 来做这样的事情:
<bean class="example.SomeBean">
<property name="anyProperty" value="#{ T(example.AppConfiguration).EXAMPLE_CONSTANT}" />
<!-- Other config -->
</bean>
那么,有没有更好的方法来做到这一点?
【问题讨论】:
-
也许我遗漏了一些东西,但为什么要在类中设置常量而不是在属性文件中?
标签: java spring constants spring-el