5
我有WEB-INF/i18n的目录下的两个文件:Spring的ReloadableResourceBundleMessageSource没有找到属性文件
- application.properties
- messages.properties
我已经正确配置我的ReloadableResourceBundleMessageSource豆如下(弹簧mvc):
<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource" p:basenames="WEB-INF/i18n/messages,WEB-INF/i18n/application"
p:fallbackToSystemLocale="false"/>
,但我从春天mvc得到这个:
2012-09-03 02:59:45,911 [http-bio-8080-exec-4] DEBUG org.springframework.context.support.ReloadableResourceBundleMessageSource - Loading properties [application.properties]
2012-09-03 02:59:45,912 [http-bio-8080-exec-4] DEBUG org.springframework.context.support.ReloadableResourceBundleMessageSource - No properties file found for [WEB-INF/i18n/application_fr] - neither plain properties nor XML
2012-09-03 02:59:45,912 [http-bio-8080-exec-4] DEBUG org.springframework.context.support.ReloadableResourceBundleMessageSource - Loading properties [messages.properties]
2012-09-03 02:59:45,912 [http-bio-8080-exec-4] DEBUG org.springframework.context.support.ReloadableResourceBundleMessageSource - No properties file found for [WEB-INF/i18n/messages_fr] - neither plain properties nor XML
任何人都可以请指教?我可以将属性文件移动到类路径中并相应地更改我的配置,但我宁愿理解正在发生的事情。
由于锂。正如你所说,它应该回落到'application.properties',所以无论我将文件的名称更改为'application_fr.properties',还是添加了您所建议的代码,我仍然得到错误...任何其他想法? – balteo
那么它不是一个错误,它的调试信息。它可能表现正确。你是否找到不正确的属性值?另外,你应该确保application.properties不管什么都存在。所以你可以制作application.properties到application_fr.properties的副本。 – Solubris
嗯。我不明白你的意思:**另外,你应该确保application.properties不管什么都存在。因此,您可以将application.properties的副本复制到application_fr.properties **具有application_fr.properties和application.properties?我已经尝试过了...... – balteo