最近学习SpringBoot,提交表单的时候出现一个问题:报错如下:
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Thu Aug 16 17:03:27 CST 2018
There was an unexpected error (type=Bad Request, status=400).
Validation failed for object='employee'. Error count: 1
校验失败:可能就是表单传递的参数格式不正确所致,解决方法:
在所需要自动注入的bean后面加上一个参数BindingResult bindingResult,即可.