find hot named entities using stanford ner
[pnews.git] / war / src / main / java / pnews / servlet / Pnews.java
index 5800d04..777f7fd 100644 (file)
@@ -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, provider);
                                 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<Article>(), cat, config.getCategories());
+                                html = HTML.toHTML(new ArrayList<Article>(), cat, config, provider);
                                 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);
                 }