为什么在没有任何注释的示例中,POST处理程序会收到表单的填充实例?
Spring MVC如何确定模型属性与POST方法中的参数之间的绑定?
@RequestMapping( value = "/myurl", method = RequestMethod.GET )
public String setView(Model model) {
MyClass instance = new MyClass();
model.addAttribute("viewParameter", instance );
return TEMPLATE_PATH;
}
@RequestMapping( value = "/myurl", method = RequestMethod.POST)
public String handleReqest(MyClass instance, Model model) {
// Why instance is populated out of the box
}