我在加载 .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
我需要程序来读取这个文件,以便记录器可以有正确的值。任何帮助将不胜感激。谢谢!