src/java/de/uapcore/lightpit/AbstractLightPITServlet.java

changeset 15
bb594abac796
parent 14
2b270c714678
child 17
d1036b776eee
equal deleted inserted replaced
14:2b270c714678 15:bb594abac796
241 Optional<Locale> reqLocale = Optional.of(req.getLocale()); 241 Optional<Locale> reqLocale = Optional.of(req.getLocale());
242 Locale sessionLocale = reqLocale.filter((rl) -> availableLanguages.map((al) -> al.contains(rl.getLanguage())).orElse(false)).orElse(Locale.ENGLISH); 242 Locale sessionLocale = reqLocale.filter((rl) -> availableLanguages.map((al) -> al.contains(rl.getLanguage())).orElse(false)).orElse(Locale.ENGLISH);
243 session.setAttribute(Constants.SESSION_ATTR_LANGUAGE, sessionLocale); 243 session.setAttribute(Constants.SESSION_ATTR_LANGUAGE, sessionLocale);
244 LOG.debug("Settng language for new session {}: {}", session.getId(), sessionLocale.getDisplayLanguage()); 244 LOG.debug("Settng language for new session {}: {}", session.getId(), sessionLocale.getDisplayLanguage());
245 } else { 245 } else {
246 LOG.trace("Continuing session {} with language {}", session.getId(), session.getAttribute(Constants.SESSION_ATTR_LANGUAGE)); 246 Locale sessionLocale = (Locale) session.getAttribute(Constants.SESSION_ATTR_LANGUAGE);
247 resp.setLocale(sessionLocale);
248 LOG.trace("Continuing session {} with language {}", session.getId(), sessionLocale);
247 } 249 }
248 250
249 req.setAttribute(Constants.REQ_ATTR_PATH, Functions.fullPath(req)); 251 req.setAttribute(Constants.REQ_ATTR_PATH, Functions.fullPath(req));
250 req.setAttribute(Constants.REQ_ATTR_MODULE_CLASSNAME, this.getClass().getName()); 252 req.setAttribute(Constants.REQ_ATTR_MODULE_CLASSNAME, this.getClass().getName());
251 moduleInfoELProxy.ifPresent((proxy) -> req.setAttribute(Constants.REQ_ATTR_MODULE_INFO, proxy)); 253 moduleInfoELProxy.ifPresent((proxy) -> req.setAttribute(Constants.REQ_ATTR_MODULE_INFO, proxy));

mercurial