title: Localization in JSF, how to remember selected locale per session instead of per request/view
body: <p><code>faces-config.xml</code>:</p>
  
  <pre><code>&lt;application&gt;
      &lt;locale-config&gt;
          &lt;default-locale&gt;ru&lt;/default-locale&gt;
          &lt;supported-locale&gt;ua&lt;/supported-locale&gt;
      &lt;/locale-config&gt;
  &lt;/application&gt; 
  </code></pre>
  
  <p>In a bean action method, I'm changing the locale in the current view as follows:</p>
  
  <pre><code>FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale("ua"));
  </code></pre>
  
  <p>The problem is that <code>ua</code> Locale is applied, but only per request/view and not for session. Another request/view within the same session resets the locale back to default <code>ru</code> value.</p>
  
  <p>How can I apply the locale for session?</p>