How to access a Spring MVC model attribute name th

2019-06-26 02:41发布

I have the following code snippet in 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
}

How can access the model attribute with the name "flash.validationErrors" in Freemarker?

1条回答
ら.Afraid
2楼-- · 2019-06-26 03:16

Try ${.data_model["flash.validationErrors"]}

查看更多
登录 后发表回答