Code example for ModelAndView

Methods: getModel

0
 
  public ModelAndView archiveList(
    int sectionid,
    String groupName
  ) throws Exception {
    ModelAndView mv = new ModelAndView("view-news-archive");
 
    Section section = sectionService.getSection(sectionid);
    mv.getModel().put("section", section);
 
    Group group = null;
    if (groupName!=null) {
      group = groupDao.getGroup(section, groupName);
    } 
 
    mv.getModel().put("group", group);
 
    List<ArchiveDao.ArchiveStats> items = archiveDao.getArchiveStats(section, group);
 
    mv.getModel().put("items", items);
 
    return mv;
  } 
 
  @RequestMapping("/gallery/archive") 
Experience pair programming with AI  Get Codota for Java