BAEL-982 - reusing model

This commit is contained in:
slavisa-baeldung 2017-09-11 06:43:00 +01:00
parent d4d0305f3e
commit 5f59a1b245
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) {