ModelAndView 和 Model ModelMap 返回值區別

當直接跳轉到jsp頁面(或forward)時,三個對象功能同樣。web ModelAndView mav = new ModelAndView(); mav.addObject("msg","hello world!"); model 和modelMap同樣,看源碼可知:modelMap是model的實現類。jsp model.addAttribute("msg", "hello world!")
相關文章
相關標籤/搜索