You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: