Spring 3 mvc namespace and i18n -


Problem with i18n and Spring 3 MVC namespace

I do not know how to solve messages For example, a JSP with this line:

  & lt; Fmt: message key = "welcome.title" /> Using Spring MVC namespace.   

Shows:

  ??? Welcome.title ???  

I have web-subset.axml (given the web name to my dispatcher servlet).

Any help greatly appreciated.

  & lt ;! - Scans for @ controllers to deploy as Beans - & gt; & Lt; Reference: component-scan base-package = "com.mylittlecompany.web.controllers" /> & Lt ;! - Enable annotation powered controller, verification etc. ... - & gt; & Lt; Mvc: annotation-operated / & gt; & Lt ;! - Configures handler interceptor - & gt; & Lt; MVC: Interceptor & gt; & Lt; Bean square = "org.springframework.web.servlet.i18n.LocaleChangeInterceptor" /> & Lt; / MVC: Interceptor & gt; & Lt ;! - App message bundle - & gt; & Lt; Bean id = "Message source" class = "org.springframework.context.support.ReloadableResourceBundleMessageSource" & gt; & Lt; Property name = "bassname" value = "/ web-INF / message / message" /> & Lt; Property Name = "CashSounds" value = "1" /> & Lt; / Bean & gt; & Lt ;! - Saves a localized change using a cookie - & gt; & Lt; Bean id = "locale resolver" category = "org.springframework.web.servlet.i18n.CookieLocaleResolver" /> & Lt ;! - / WEB-INF / Reserves protected .jsp resources in view directory - View & gt; & Lt; Bean square = "org.springframework.web.servlet.view.InternalResourceViewResolver" & gt; & Lt; Property Name = "Prefix" Value = "/ Web-NF / JSP /" /> & Lt; Property name = "suffix" value = ".jsp" /> & Lt; / Bean & gt;  

Only relevant log file entry:

  argument thread-1 org.springframework.web.context.support.XmlWebApplicationContext - MessageSource [org.springframework.context.support.ReloadableResourceBundleMessageSource: basenames = [/ WEB-INF / message / message]]  

ResourceBundle is now looking for your files in the "/ WEB-INF / Message" package that does not exist.

Source converting your "message" directory to web-INF / classes and message with:

  & lt; Bean id = "messageSource" class = "org.springframework.context.support.ReloadableResourceBundleMessageSource" & gt; & Lt; Property Name = "BaseName" Value = "Message / Message" /> & Lt; Property Name = "CashSounds" value = "1" /> & Lt; / Bean & gt;  

Comments