title: Language selection in the combo
body: <p>I configured my servlet to support internationalization, just as I showed below:</p>
  
  <pre><code>&lt;bean id="messageSource"
      class="org.springframework.context.support.ReloadableResourceBundleMessageSource"&gt;
      &lt;property name="basename" value="classpath:messages" /&gt;
      &lt;property name="defaultEncoding" value="UTF-8"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="localeChangeInterceptor"
      class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"&gt;
      &lt;property name="paramName" value="lang" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="localeResolver"
      class="org.springframework.web.servlet.i18n.CookieLocaleResolver"&gt;
      &lt;property name="defaultLocale" value="en"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="handlerMapping"
      class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"&gt;
      &lt;property name="interceptors"&gt;
          &lt;ref bean="localeChangeInterceptor" /&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>On the JSP page, I added the choice of language in such a way:</p>
  
  <pre><code>&lt;%@taglib uri="http://www.springframework.org/tags" prefix="spring"%&gt;
  
  
  &lt;h3&gt;&lt;spring:message code="label.title"/&gt;&lt;/h3&gt;
  
  &lt;span style="float: right"&gt;
      &lt;a href="?lang=en"&gt;en&lt;/a&gt;
      |
      &lt;a href="?lang=de"&gt;de&lt;/a&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>How do I replace the above code component of a select (combo)?</p>
  
  <p>(pseudo code)</p>
  
  <pre><code>&lt;td&gt;&lt;form:select path="language" onchange=""&gt;
              &lt;form:option value="0" label="..." /&gt;
              &lt;form:options items="${languageList}" /&gt;
          &lt;/form:select&gt;&lt;/td&gt;
  </code></pre>
  
  <p>Please help</p>
  
  <p>EDIT
  I do not want anything to set as the default. He wants to be chosen this option, he chose you. You will see an example:</p>
  
  <p>The first step
  localhost: 8080/newUser
  ->
  In controller</p>
  
  <pre><code>@ RequestMapping (value = "/ newuser" method = RequestMethod.GET)
  public ModelAndView showNewUser (ModelMap model) {
  ModelAndView mav = new ModelAndView ();
  mav.mav.setViewName ("newuser");
  User user = new User ();
  mav.getModel (). put ("user", user);
  return mav;
  </code></pre>
  
  <p>My JSP forms
  ...</p>
  
  <pre><code>&lt;form id="langForm" action="newUse" method="get"&gt;
  &lt;table&gt;
  &lt;tr&gt;
  &lt;td&gt; &lt;a href="#"&gt; &lt;spring:message code="label.helpLink" /&gt; &lt;/ a&gt; &lt;/ td&gt;
  &lt;td&gt; &lt;select name="lang" id="lang"&gt;
  &lt;option value="de"&gt; &lt;spring:message code="languageName.de"&gt; &lt;/ spring: message&gt; &lt;/ option&gt;
  &lt;option value="en"&gt; &lt;spring:message code="languageName.en"&gt; &lt;/ spring: message&gt; &lt;/ option&gt;
  &lt;/ select&gt; &lt;/ td&gt;
  &lt;/ tr&gt;
  &lt;/ table&gt;
  &lt;/ form&gt;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $ ("# lang"). change (function () {
  document.forms ["langForm"] submit ();
  });
  &lt;/ script&gt;
  </code></pre>
  
  <p>The second step
  - End-user selects from the combo options "languageName.en. Followed by reloading the page
  (localhost: 8080/newUser? lang = en) to change the language to EN but the combo is still selected as the first item. I would like to chose was the one you selected in step 2 So, I would save the state.</p>
  
  <p>ADDED</p>
  
  <pre><code>&lt;form&gt;
          &lt;select name="lang" id="lang" onchange="this.form.submit();"&gt;
              &lt;option value="pl"&gt;&lt;spring:message code="languageName.pl"&gt;&lt;/spring:message&gt;&lt;/option&gt;
              &lt;option value="en"&gt;&lt;spring:message code="languageName.en"&gt;&lt;/spring:message&gt;&lt;/option&gt;
          &lt;/select&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>How to keep the option without a model?</p>