Tôi có hai tập tin trong thư mục/i18n WEB-INF:tính ReloadableResourceBundleMessageSource không tìm thấy mùa xuân của tập tin
- application.properties
- messages.properties
Tôi đã cấu hình đúng đậu ReloadableResourceBundleMessageSource của tôi như sau (spring mvc):
<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource" p:basenames="WEB-INF/i18n/messages,WEB-INF/i18n/application"
p:fallbackToSystemLocale="false"/>
nhưng tôi nhận được điều này từ Mùa xuân 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
Bất cứ ai có thể vui lòng thông báo? Tôi có thể di chuyển các tập tin thuộc tính để classpath và thay đổi cấu hình của tôi cho phù hợp nhưng tôi muốn hiểu những gì đang xảy ra.
Cảm ơn Lithium. Như bạn nói nó nên quay trở lại 'application.properties' vì vậy cho dù tôi thay đổi tên của tập tin thành' application_fr.properties' hoặc tôi thêm mã bạn đề nghị, tôi vẫn nhận được lỗi ... Bất kỳ ý tưởng nào khác? – balteo
Cũng không phải là lỗi của nó, đó là một thông báo gỡ lỗi. Nó có thể hoạt động chính xác. Bạn đang tìm các giá trị thuộc tính không chính xác? Ngoài ra, bạn nên đảm bảo application.properties tồn tại không có vấn đề gì. Vì vậy, bạn có thể tạo một bản sao của application.properties cho application_fr.properties. – Solubris
Ummm. Tôi không hiểu ý của bạn là gì: ** Ngoài ra, bạn nên đảm bảo application.properties tồn tại không có vấn đề gì. Vì vậy, bạn có thể tạo một bản sao của application.properties cho application_fr.properties ** Có application_fr.properties và application.properties? Tôi đã thử rồi ... – balteo