I use Spring MVC, Tomcat 7 server.
When the site is localized, an HTTP Status 500 error - javax.servlet.ServletException occurs : javax.servlet.jsp.JspTagException: No message found under the code 'home' for locale 'en_US'. BUT I do not use Russian localization in general, only English and Ukrainian. Accordingly, there are two files, messages_en.properties and messages_ua.properties.
This error occurs only on the first page that is listed in on other pages, everything is fine, and the message change is correct.
-Servlet.xml code
<bean class="org.springframework.context.support.ReloadableResourceBundleMessageSource" id="messageSource"> <property name="basename" value="classpath:/messages"></property> <property name="defaultEncoding" value="UTF-8"></property> </bean> <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" id="localeChangeInterceptor"> <property name="paramName" value="lang"></property> </bean> <bean class="org.springframework.web.servlet.i18n.CookieLocaleResolver" id="localeResolver"> <property name="defaultLocale" value="en"></property> </bean> The index.jsp page displays <spring:message code="home"/> .
Inteliji, chrome, tomcat tried to clear the cache - it did not help.
Link to git with the project https://github.com/seltsamD/trouble_localization
<property name="fallbackToSystemLocale" value="false"></property>to themessageSourcebeanmessageSource. I also advise you to renamemessages_en.propertiesinmessages.properties. - Slava Semushin