我在Spring MVC(3.0)中有以下代码片段。
@RequestMapping(value="/add", method = RequestMethod.POST)
public String handleAddResourceGroup(@Valid ResourceGroup resourceGroup, BindingResult bindingResult, Model model) {
if (bindingResult.hasErrors()) {
model.addAttribute("flash.validationErrors", bindingResult.getAllErrors());
return "add";
}
//The rest of the code
}
如何在Freemarker中使用名称“flash.validationErrors”访问model属性?
答案 0 :(得分:2)
尝试${.data_model["flash.validationErrors"]}