navigation with hot topics
[pnews.git] / war / src / main / java / pnews / servlet / Pnews.java
index 777f7fd..69ad1bc 100644 (file)
@@ -105,20 +105,20 @@ public class Pnews extends HttpServlet {
         }
 
         
-        private void writeArticles(Category cat, HttpServletResponse rp) {
+        private void writeArticles(Category cat, String entity, HttpServletResponse rp) {
                 String html;
                 List<Article> articles;
 
                 try {
-                        articles = provider.getArticles(cat);
+                        articles = provider.getArticles(cat, entity);
                         if (articles != null) {
-                                html = HTML.toHTML(articles, cat, config, provider);
+                                html = HTML.toHTML(articles, cat, entity, 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, provider);
+                                html = HTML.toHTML(new ArrayList<Article>(), cat, entity, config, provider);
                                 rp.setContentType("text/html");
                                 rp.getWriter().write(html);
                         }
@@ -186,7 +186,7 @@ public class Pnews extends HttpServlet {
                 
                         for (Category cat: config.getCategories()) {
                                 if (path.equals(cat.getURL())) {
-                                        writeArticles(cat, resp);
+                                        writeArticles(cat, getQueryParameter(req, "entity"), resp);
                                         return ;
                                 }
                         }