Open sunbyte opened 1 year ago
Hey @sunbyte If you're trying to put @Valid Todo todo before ModelMap modelMap , keep in mind that the BindingResult parameter must immediately follow the @Valid annotated object. Spring MVC uses BindingResult to collect validation errors for the todo object. If it's not positioned correctly after @Valid, Spring may not be able to capture validation errors correctly, leading to unexpected behavior.
Hello!
I have question about spring boot validation in Todo project.
public String addNewTodo(ModelMap modelMap, @Valid Todo todo, BindingResult bindingResult) {...}
If we change the position of the method parameters and put @Valid Todo todo before ModelMap modelMap, the validation not work correct and we don't see the error message in the form, but getting an exceptions in the browser. Why?
Thanks.