方法一:HttpServletRequest
方法二:Model
方法三:ModelAndView(推荐)🌟
转发
forward:页面地址
@RequestMapping("/showPage1")
public String showPage1() {
System.out.println("user mvc controller is running ...");
return "forward:page.jsp";
}
重定向
redirect:页面地址
@RequestMapping("/showPage2")
public String showPage2() {
System.out.println("user mvc controller is running ...");
return "redirect:page.jsp";
}