开发者

How to access a Spring MVC model attribute name that contain a dot in Freemarker

开发者 https://www.devze.com 2023-02-18 14:32 出处:网络
I have the following code snippet in Spring MVC (3.0). @RequestMapping(value开发者_C百科=\"/add\", method = RequestMethod.POST)

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"]}

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号