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)); |