X-Git-Url: https://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=war%2Fsrc%2Fmain%2Fjava%2Fpnews%2Fservlet%2FPnews.java;h=029f3c76f0dfc50e02b6b4f1e94412220e045435;hb=47bc9d3dc6b3cf77957f11bceea1bcda492f8818;hp=5800d0435741c143996e4578f565f521b069e13d;hpb=69746f2a8087043f7548849d78353281fbb5527f;p=pnews.git diff --git a/war/src/main/java/pnews/servlet/Pnews.java b/war/src/main/java/pnews/servlet/Pnews.java index 5800d04..029f3c7 100644 --- a/war/src/main/java/pnews/servlet/Pnews.java +++ b/war/src/main/java/pnews/servlet/Pnews.java @@ -112,13 +112,13 @@ public class Pnews extends HttpServlet { try { articles = provider.getArticles(cat); if (articles != null) { - html = HTML.toHTML(articles, cat, config.getCategories()); + html = HTML.toHTML(articles, cat, config); rp.setContentType("text/html;charset=utf-8"); rp.getWriter().write(html); rp.setCharacterEncoding("utf-8"); } else { LOG.severe("writeArticles cannot retrieve any articles"); - html = HTML.toHTML(new ArrayList
(), cat, config.getCategories()); + html = HTML.toHTML(new ArrayList
(), cat, config); rp.setContentType("text/html"); rp.getWriter().write(html); } @@ -193,14 +193,14 @@ public class Pnews extends HttpServlet { for (Language l: config.getLanguages()) { if (path.equals(l.toURL())) { - doTemporaryRedirect(config.getDefaultCategory().getURL(), resp); + doTemporaryRedirect(config.getDefaultCategory(l).getURL(), resp); return ; } } resp.getWriter().write("Not found " + req.getPathInfo()); resp.setStatus(HttpServletResponse.SC_NOT_FOUND); - } catch (IOException e) { + } catch (IOException | RuntimeException e) { LOG.log(Level.SEVERE, "doGet failure", e); resp.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); }