Skip to content

Commit 5f59a1b

Browse files
BAEL-982 - reusing model
1 parent d4d0305 commit 5f59a1b

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎mustache/src/main/java/com/baeldung/springmustache/controller/ArticleController.java‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ public ModelAndView displayArticle(Map<String, Object> model) {
2222
.mapToObj(i -> generateArticle("Article Title " + i))
2323
.collect(Collectors.toList());
2424

25-
Map<String, Object> modelMap = new HashMap<>();
26-
modelMap.put("articles", articles);
25+
model.put("articles", articles);
2726

28-
return new ModelAndView("index", modelMap);
27+
return new ModelAndView("index", model);
2928
}
3029

3130
private Article generateArticle(String title) {

0 commit comments

Comments
 (0)