Spring mvc Controll的几种中返回ModelAndView

1.return new ModelAndView("admin/delMsg",model);
2.return new ModelAndView("redirect:/u/"+currUser.getUserName());
3.return new ModelAndView(successView);
4.return new ModelAndView(successView).addObject("articleList", articleList.getItems()).addObject("channel", channel)

采用惯例优先原则

ModelAndView mav=new ModelAndView("admin/delMsg");
mav.addObject("user",user),
mav.addObject("blog",blog),
return mav;

你可能感兴趣的:(spring,mvc,Blog)