1、利用ModelAndView页面传值
后台程序如下:
@RequestMapping(value="/reciveData",method=RequestMethod.GET)
public ModelAndView StartPage() {
ModelMap map=new ModelMap();
User user=new User();
user.setPassword("123456");
user.setUserName("ZhangSan");
map.put("user", user);
return new ModelAndView("reciveControllerData",map);
}
页面程序如下:
recive Data From Controller
用户名:${user.userName }
密码:${user.password }