title: i18 message property does not reflect in JSP through Controller
body: <p>Appreciate any help as I am lost in getting these things together and JSP does not show spring message as per language which is passed in URL argument. JSP is not getting SessionLocale thru SessionLocaleResolver when different language are selected in welcome.jsp. What am I doing/going wrong.</p>
  <p>I am using Spring 3.1.1. Thanks in advance</p>
  <pre><code>&lt;!-- Configures the @Controller programming model --&gt;
  &lt;mvc:annotation-driven /&gt;
  
  &lt;!-- Enables the Spring MVC @Controller programming model --&gt;
  &lt;mvc:view-controller path=&quot;/views/**&quot; view-name=&quot;secure/index&quot; /&gt;
  
  &lt;bean id=&quot;localeResolver&quot;
      class=&quot;org.springframework.web.servlet.i18n.SessionLocaleResolver&quot;&gt;
      &lt;property name=&quot;defaultLocale&quot; value=&quot;en&quot; /&gt;
  &lt;/bean&gt;
  
  &lt;!-- URL interceptor --&gt;
  &lt;bean id=&quot;localeChangeInterceptor&quot;
      class=&quot;org.springframework.web.servlet.i18n.LocaleChangeInterceptor&quot;&gt;
      &lt;property name=&quot;paramName&quot; value=&quot;lang&quot; /&gt;
  &lt;/bean&gt;
  
  &lt;bean id=&quot;handlerMapping&quot;
      class=&quot;org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping&quot;&gt;
      &lt;property name=&quot;interceptors&quot;&gt;
          &lt;ref bean=&quot;localeChangeInterceptor&quot; /&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  
  &lt;!-- Application Message Bundle --&gt;
  &lt;bean id=&quot;messageSource&quot;
      class=&quot;org.springframework.context.support.ReloadableResourceBundleMessageSource&quot;&gt;
      &lt;property name=&quot;basename&quot; value=&quot;classpath:messages&quot; /&gt;
  &lt;/bean&gt;
  
  &lt;bean id=&quot;viewResolver&quot;
      class=&quot;org.springframework.web.servlet.view.InternalResourceViewResolver&quot;&gt;
      &lt;property name=&quot;viewClass&quot;
          value=&quot;org.springframework.web.servlet.view.JstlView&quot; /&gt;
      &lt;property name=&quot;prefix&quot; value=&quot;/WEB-INF/views/&quot; /&gt;
      &lt;property name=&quot;suffix&quot; value=&quot;.jsp&quot; /&gt;
  &lt;/bean&gt;
  </code></pre>
  <p>My WelcomeController</p>
  <pre><code>@Controller
  public class WelcomeController {
  
  @Autowired
  private MessageSource messageSource;
  
  public void setMessageSource(MessageSource messageSource) {
      this.messageSource = messageSource;
  }
  
  @RequestMapping(value = &quot;/welcome&quot;, method = RequestMethod.GET)
  public String welcome(Model model, HttpServletRequest request, HttpServletResponse response) {
      String lang = request.getParameter(&quot;lang&quot;);
      if (lang == null) {
          lang = &quot;en_US&quot;;
      }
      /**
       * Get Message having PARAMETERS in the message {0}, {1}.....{n}
       */
      model.addAttribute(
              &quot;welcome_back_msg&quot;,
                  messageSource.getMessage(&quot;message_welcome_back_user&quot;, new Object[] { &quot;(USER)&quot;,
                          new DateTime(), new DateTime() }, new Locale(lang)));
      return &quot;welcome&quot;;
  }
  }
  </code></pre>
  <p>Message files are placed in /WEB-INF/messages/
  messages_en.properties</p>
  <pre><code>welcome_springmvc=Welcome to Spring MVC
  message_welcome_back_user=Welcome back {0} Your Last Successful : {1} Failed : {2}
  </code></pre>
  <p>messages_zh.properties</p>
  <pre><code>welcome_springmvc=\u6B22\u8FCE\u5230 Spring \u7684 MVC
  </code></pre>
  <p>message_welcome_back_user=\u6B22\u8FCE\u56DE\u6765 {0} \u4E0A\u6B21\u6210\u529F : {1} \u5931\u8D25 : {2}</p>
  <p>messages_fr.properties</p>
  <pre><code>welcome_springmvc=Bienvenue \u00E0 Spring MVC
  </code></pre>
  <p>message_welcome_back_user=Bienvenue \u00E0 nouveau {0} Votre r\u00E9ussite Derni\u00E8re : {1} manqu\u00E9 : {2}</p>
  <p>--- welcome.jsp</p>
  <pre><code>Spring Message from Property:&lt;b&gt;&lt;spring:message code=&quot;welcome_springmvc&quot; text=&quot;default text&quot; /&gt;&lt;/b&gt;
  Message from Controller:&lt;b&gt;${welcome_back_msg}
  </code></pre>
  <p>JSP Image
  <img src="https://i.stack.imgur.com/8Dnxw.jpg" alt="enter image description here" /></p>
  <p>You can see Spring Message from Property always fallsback to locale = en.
  Appreciate any help in this regards.</p>