title: JSTL I changed language and on other sub pages is back to default language
body: <p>I have problem with JSTL formatting library. When I changed and clicked link to other subpage it return me site with default language, not with this what I chose.</p>
  
  <p><strong>I have four files with messages:</strong></p>
  
  <p>mylabels_pl_PL.properties</p>
  
  <p>mylabels_en_EN.properties</p>
  
  <p>mylabels_de_DE.properties</p>
  
  <p>mylabels.properties</p>
  
  <p><strong>Entry point of web application is file: index.jsp</strong></p>
  
  <p>content:</p>
  
  <pre><code>  &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
    &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %&gt;
  
   &lt;c:set var="theLocale" value="${not empty param.theLocale ? param.theLocale : pageContext.request.locale}" scope="session" /&gt;
   &lt;fmt:setLocale value="${theLocale}" /&gt;
   &lt;fmt:setBundle basename="multilanguage.mylabels" /&gt;
  
   &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;title&gt;
          &lt;fmt:message key="label.title" /&gt;
      &lt;/title&gt;
  
      &lt;link rel="stylesheet" type="text/css" href="css/index.css"&gt;
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/index.js" async&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  
  &lt;body onload="assignDestinationForm()"&gt;
  
      &lt;header class="languages"&gt;
          &lt;nav&gt;
              &lt;ul&gt;        
                  &lt;li&gt;
                      &lt;a href="index.jsp?theLocale=en_EN"&gt;
                          &lt;img src="img/england.jpg" alt="" id="imgEngland"&gt;
                      &lt;/a&gt;
                  &lt;/li&gt;       
                  &lt;li&gt;
                      &lt;a href="index.jsp?theLocale=de_DE"&gt;
                          &lt;img src="img/germany.jpg" alt="" id="imgGermany"&gt;
                      &lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;a href="index.jsp?theLocale=pl_PL"&gt;
                          &lt;img src="img/poland.jpg" alt="" id="imgPoland"&gt;
                      &lt;/a&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/nav&gt;
      &lt;/header&gt;
  
      &lt;div style="clear: both;"&gt;&lt;/div&gt;
  
      &lt;header class="title"&gt;
          &lt;h1&gt;
              &lt;fmt:message key="label.title" /&gt;
          &lt;/h1&gt;
      &lt;/header&gt;
  
      &lt;article&gt;
          &lt;section&gt;
  
          &lt;/section&gt;
      &lt;/article&gt;
  
      &lt;div id="container"&gt;
          &lt;form id="myForm" action=""&gt;
              &lt;button id="btnSignIn"&gt;
                  &lt;fmt:message key="label.login" /&gt;
              &lt;/button&gt;
              &lt;button id="btnSignUp"&gt;
                  &lt;fmt:message key="label.register" /&gt;
              &lt;/button&gt;
          &lt;/form&gt;
      &lt;/div&gt;
  
      &lt;footer&gt;
          &lt;fmt:message key="label.footer" /&gt;
      &lt;/footer&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>second subpage: login-form.jsp</strong></p>
  
  <pre><code>&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %&gt;
  &lt;%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %&gt;
  
  &lt;c:set var="theLocale" value="${not empty param.theLocale ? param.theLocale : pageContext.request.locale}" scope="session" /&gt;
  &lt;fmt:setLocale value="${theLocale}" /&gt;
  &lt;fmt:setBundle basename="multilanguage.mylabels" /&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  
  &lt;head&gt;
      &lt;title&gt;
          &lt;fmt:message key="label.login" /&gt;
      &lt;/title&gt;
  
      &lt;link rel="stylesheet" type="text/css" href="css/login-form.css"&gt;
      &lt;script type="text/javascript" src="&lt;%=request.getContextPath()%&gt;/js/index.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body onload="assignDestinationForm()"&gt;
  
      &lt;header class="languages"&gt;
          &lt;nav&gt;
              &lt;ul&gt;        
                  &lt;li&gt;
                      &lt;a href="login-form.jsp?theLocale=en_EN"&gt;
                          &lt;img src="img/england.jpg" id="btnEngland" alt=""&gt;
                      &lt;/a&gt;
                  &lt;/li&gt;       
                  &lt;li&gt;
                      &lt;a href="login-form.jsp?theLocale=de_DE"&gt;
                          &lt;img src="img/germany.jpg" id="btnGermany" alt=""&gt;
                      &lt;/a&gt;
                  &lt;/li&gt;
                  &lt;li&gt;
                      &lt;a href="login-form.jsp?theLocale=pl_PL"&gt;
                          &lt;img src="img/poland.jpg" id="btnPoland" alt=""&gt;
                      &lt;/a&gt;
                  &lt;/li&gt;
              &lt;/ul&gt;
          &lt;/nav&gt;
      &lt;/header&gt;
  
      &lt;article&gt;
          &lt;section&gt;
              &lt;h1&gt;
                  &lt;fmt:message key="label.login" /&gt;
              &lt;/h1&gt;
              &lt;div id="container"&gt;
                  &lt;form action="" method="get"&gt;
                      &lt;fmt:message key="label.username" /&gt; &lt;br /&gt;
                      &lt;input type="text" name="userName" id="userName"&gt;
                      &lt;br /&gt;&lt;br /&gt;
                      &lt;fmt:message key="label.password" /&gt; &lt;br /&gt;
                      &lt;input type="password" name="password" id="password"&gt; 
                      &lt;br /&gt;&lt;br /&gt;
                      &lt;button id="btnForm"&gt;
                          &lt;fmt:message key="label.btnLogin" /&gt;
                      &lt;/button&gt;           
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/section&gt;
      &lt;/article&gt;
  
  
  
  
  
      &lt;footer&gt;
          &lt;fmt:message key="label.footer" /&gt;
      &lt;/footer&gt;   
  
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>I have page register-form.jsp yet but there is only form for sign up and look like similar to login-form.jsp.</p>
  
  <p>How set that after clicked on image with flag of the country assign specified language and after click on the link to login-form.jsp the will be the same chose language?</p>