标签:
@RequestMapping("") public ModelAndView index(HttpSession session) { Object data = session.getAttribute("user"); ModelAndView view = new ModelAndView("main/index"); view.addObject("message", "验证失败,正在跳转中..."); if (data != null) { return view; } else { return view; } }
@RequestMapping(value = "test", method = RequestMethod.GET) public String test(Model model) { model.addAttribute("parametername", "handsome"); return "test"; }
springmvc ModelAndView 和 Model
标签:
原文地址:http://www.cnblogs.com/zhangwei595806165/p/4676630.html