New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BindingResult errors from @ModelAttribute are not carried over to @RequestMapping annotated method [SPR-11722] #16344
Comments
Rossen Stoyanchev commented
I'm not sure what you mean here. Model attribute methods are used to add attributes to the model. Actual binding and validation of command objects is in the |
Vladimir Semenov commented Here is an example illustrating what I meant:
|
Rossen Stoyanchev commented Thanks for the extra detail. What is your intent actually? The above example causes binding and validation on the command object twice -- once at the |
Rossen Stoyanchev commented Actually I should qualify "even if possible". We've never supported this style explicitly so while it is not failing with an exception of any kind, I am not surprised the BindingResult from the |
Vladimir Semenov commented Our use case for it is to provide default CAPTCHA and IP throttling implementation that gets invoked prior to |
Rossen Stoyanchev commented I see, well this really isn't meant to be used this way. Data binding and validation for the command object happen at the Can you invoke it after the This may also be related to #15486 so I look forward to you comment, thanks. |
Vladimir Semenov opened SPR-11722 and commented
BindingResult errors generated in
@ModelAttribute
annotated method are not carried over into the BindingResult passed to@RequestMapping
annotated method in the same controller.This appears to be a bug since
@ModelAttribute
annotated method accepts BindingResult, and errors in Model from@ModelAttribute
annotated method are carried over to@RequestMapping
annotated method, but errors from BindingResult are not.Affects: 3.1 GA
The text was updated successfully, but these errors were encountered: