I have the following code snippet in Spring MVC (3.0).
@RequestMapping(value开发者_C百科="/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
}
How can access the model attribute with the name "flash.validationErrors" in Freemarker?
Try ${.data_model["flash.validationErrors"]}
精彩评论