Code example for ModelAndView

Methods: getModel

0
 
    if (!tmpl.isSessionAuthorized()) {
      throw new AccessViolationException("Not authorized"); 
    } 
 
    ModelAndView mv = new ModelAndView("edit-remark");
 
    User user = userDao.getUser(nick);
    if (tmpl.isSessionAuthorized() && !tmpl.getNick().equals(nick) ) {
      Option<Remark> remark = remarkDao.getRemark(tmpl.getCurrentUser(), user);
      if (remark.isDefined()) {
        mv.getModel().put("remark", remark.get());
      } 
    }else{ 
      throw new AccessViolationException("Not Authorized"); 
    } 
    return mv;
  } 
 
  @RequestMapping(method=RequestMethod.POST)
Connect your IDE to all the code out there  Get Codota for Java