src/main/webapp/WEB-INF/jsp/language.jsp

changeset 86
0a658e53177c
parent 74
91d1fc2a3a14
child 180
009700915269
--- a/src/main/webapp/WEB-INF/jsp/language.jsp	Sat May 30 18:12:38 2020 +0200
+++ b/src/main/webapp/WEB-INF/jsp/language.jsp	Mon Jun 01 14:46:58 2020 +0200
@@ -25,23 +25,19 @@
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
 --%>
 <%@page pageEncoding="UTF-8" %>
-<%@page import="de.uapcore.lightpit.Constants" %>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 
-<jsp:useBean id="languages" type="java.util.List<java.util.Locale>" scope="request"/>
-<jsp:useBean id="browserLanguage" type="java.util.Locale" scope="request"/>
-
-<c:set scope="page" var="currentLanguage" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"/>
+<jsp:useBean id="viewmodel" type="de.uapcore.lightpit.viewmodel.LanguageView" scope="request"/>
 
 <form method="POST" id="lang-selector">
-    <c:forEach items="${languages}" var="l">
+    <c:forEach items="${viewmodel.languages}" var="l">
         <label>
             <input type="radio" name="language" value="${l.language}"
-                   <c:if test="${l.language eq currentLanguage.language}">checked</c:if>/>
+                   <c:if test="${l.language eq viewmodel.currentLanguage.language}">checked</c:if>/>
                 ${l.displayLanguage}
-            (${l.getDisplayLanguage(currentLanguage)}
-            <c:if test="${not empty browserLanguage and l.language eq browserLanguage.language}"><c:set
+            (${l.getDisplayLanguage(viewmodel.currentLanguage)}
+            <c:if test="${not empty viewmodel.browserLanguage and l.language eq viewmodel.browserLanguage.language}"><c:set
                     var="browserLanguagePresent" value="true"/>&nbsp;-&nbsp;<fmt:message key="browserLanguage"/></c:if>)
         </label>
     </c:forEach>

mercurial