16171819202122
this.articleDao = articleDao; } @GET public ArticlesView show() { return new ArticlesView(articleDao.findNewestArticles(5)); }
20212223242526
} @GET public ArticlesView search(@QueryParam("term") String term) { List<Article> articles = articleDao.findBySlugAndText(term, term); return new ArticlesView(articles); }
this.articleDao = articleDao; } @GET public ArticlesView searchByTag(@PathParam("tag") String tag) { return new ArticlesView(articleDao.findByTag(tag)); }