【发布时间】:2010-07-27 14:26:08
【问题描述】:
ModelMap 只是 Spring 3 中 ModelAndView 的新名称吗?
Spring 3 中的功能有变化吗?
考虑在 Spring 3 应用程序中使用 ModelMap 的这段代码:
@RequestMapping(value = "/order", method = RequestMethod.GET)
public final String setup(final ModelMap model)
{
model.addAttribute(ORDER, new Order());
return "setup";
}
我想知道ModelAndView 在旧版 Spring 应用程序中的等效用途是什么?是否只需要将名称从 ModelMap 更改为 ModelAndView 以使其在 Spring 2.5 中正常工作?
【问题讨论】:
标签: java spring spring-mvc