sringMVC ModelAndView实例

@RequestMapping("/aa")

public ModelAndView aa(Model model,ModelAndView mav){

System.out.println("进入从controller方法");

String s = "xxxxxxxxxxxx";

// mav.setViewName("index");//返回页面

// mav.addObject("s", s);//传递值

return new ModelAndView("index","s",s);//参数1:返回页面。参数2和参数3:传递的值

}

你可能感兴趣的:(sringMVC ModelAndView实例)