Merge pull request #2603 from eugenp/BAEL-982

BAEL-982 - reusing model
This commit is contained in:
slavisa-baeldung 2017-09-11 13:31:31 +02:00 committed by GitHub
commit 19204f5d2f
1 changed files with 2 additions and 3 deletions

View File

@ -22,10 +22,9 @@ public class ArticleController {
.mapToObj(i -> generateArticle("Article Title " + i))
.collect(Collectors.toList());
Map<String, Object> modelMap = new HashMap<>();
modelMap.put("articles", articles);
model.put("articles", articles);
return new ModelAndView("index", modelMap);
return new ModelAndView("index", model);
}
private Article generateArticle(String title) {