我有一个像这样的控制器
@RequestMapping("/welcome")
@ResponseBody
public ModelAndView welcome() {
ModelAndView modelAndView = new ModelAndView("welcome");
modelAndView.addObject("name", "john");
return modelAndView;
}
当我通过Postman应用向/welcome
发出请求时,可以在任何地方获取“ welcome.jsp as response. However, I cannot see the object
name”页面的HTML。我怎么看?
我modelAndView.addObject("name", "john");
时会发生什么?