RestController风格下对页面的跳转

 

ModelAndView model = new ModelAndView();
model.setViewName("userAdd");

return model;

 

=========================================================================

返回数据

HashMap<String, Object> hashMap = new HashMap<>();
Car car = new Car();
car.setCarColor("红色");
car.setCarDischarge("好看");
hashMap.put("car", car);
hashMap.put("name","zhangsan");
hashMap.put("age","18");

return hashMap;

 

 

相关文章: