Why does BindingResult have to follow @Valid?

前端 未结 3 1974
遥遥无期
遥遥无期 2020-12-06 06:28

I was struggling to get my Spring MVC validation to return to the page submitted page when I had errors. I finally solved the problem by noticing that BindingResult needs to

3条回答
  •  难免孤独
    2020-12-06 07:15

    You can potentially have multiple model attributes in your request handler, each with their own binding result. To accomodate this, Spring decided to bind binding result parameters to the previous paramater.

提交回复
热议问题