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

changeset 160
e2d09cf3fb96
parent 159
86b5d8a1662f
child 163
a5b9632729b6
equal deleted inserted replaced
159:86b5d8a1662f 160:e2d09cf3fb96
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);

mercurial