Spring ReloadableResourceBundleMessageSource cannot find property file

I have two files in the WEB-INF / i18n directory:

  • application.properties
  • messages.properties

I correctly set up my ReloadableResourceBundleMessageSource bean as follows (spring MVC):

<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource" p:basenames="WEB-INF/i18n/messages,WEB-INF/i18n/application"
        p:fallbackToSystemLocale="false"/>

and yet I get this from Spring 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

Can anyone advise? I could move the property files to the class path and change my config accordingly, but I would better understand what is happening.

+5
source share
1 answer

The log message says the following: application_fr

_fr. , application.properties(application_fr.properties). , (application.properties), . , , , - . , JVM, .

, -:

<bean class="org.springframework.web.servlet.i18n.FixedLocaleResolver" p:defaultLocale="en"/>   
+1

All Articles