403 private static String jspPath(String filename) { |
403 private static String jspPath(String filename) { |
404 return enforceExt(Constants.JSP_PATH_PREFIX + filename, ".jsp"); |
404 return enforceExt(Constants.JSP_PATH_PREFIX + filename, ".jsp"); |
405 } |
405 } |
406 |
406 |
407 private void doProcess(HttpMethod method, HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
407 private void doProcess(HttpMethod method, HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { |
|
408 // the very first thing to do is to force UTF-8 |
|
409 req.setCharacterEncoding("UTF-8"); |
408 |
410 |
409 // choose the requested language as session language (if available) or fall back to english, otherwise |
411 // choose the requested language as session language (if available) or fall back to english, otherwise |
410 HttpSession session = req.getSession(); |
412 HttpSession session = req.getSession(); |
411 if (session.getAttribute(Constants.SESSION_ATTR_LANGUAGE) == null) { |
413 if (session.getAttribute(Constants.SESSION_ATTR_LANGUAGE) == null) { |
412 Optional<List<String>> availableLanguages = availableLanguages().map(Arrays::asList); |
414 Optional<List<String>> availableLanguages = availableLanguages().map(Arrays::asList); |