【发布时间】:2013-07-01 15:03:03
【问题描述】:
我在加载 .properties 文件时遇到问题。
该文件名为“businessmessages_en_US.properties”,存储在“src/main/resources/config/i18n”中。我在构建路径中添加了“src/main/resources”,并在我的 spring xml 中创建了一个 bean:
<bean name="messageResource" id="messageResource"
class="[package].CustomResourceBundleMessageSourceImpl">
<property name="basename">
<value>classpath*:config/i18n/*.properties</value>
</property>
</bean>
注意“basename”属性根据类必须是字符串
然而,每次我运行我的程序时,记录器都会发送一条消息:
01 Jul 2013 09:12:34,267 WARN [package].CustomResourceBundleMessageSourceImpl - ResourceBundle [classpath*:config/i18n/*.properties] not found for MessageSource: Can't find bundle for base name classpath*:config/i18n/*.properties, locale en_US
我需要程序来读取这个文件,以便记录器可以有正确的值。任何帮助将不胜感激。谢谢!
【问题讨论】:
标签: java spring properties javabeans