【已解决】The server cannot or will not process the request due to something that is perceived ..

页面错误描述如下:
【已解决】The server cannot or will not process the request due to something that is perceived ..

错误描述:
The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

意思是服务器不处理来自客户端的错误请求,一般是请求语法,无效的请求信息等错误原因。

博主在提交表单的时候遇到了这个问题,后来重新检查了一下代码,发现了问题原因:
在提交表单的时候,用户名和密码填写的数据类型与Controller层的接收类型不一致导致报错,如果有相同错误的朋友,可以检查一下代码,看看是不是请求参数错误,表单传过去的数据无法与pojo对象匹配,导致400错误。

这里定义的User接收参数,用户名为字符串,密码为数字:
【已解决】The server cannot or will not process the request due to something that is perceived ..
当密码输入了字符串,导致400:
【已解决】The server cannot or will not process the request due to something that is perceived ..
【已解决】The server cannot or will not process the request due to something that is perceived ..

解决办法:
表单填写的数据与pojo对象的参数类型一致。
此外,可以对这个错误自定义一个报错页面,在输出参数错误的时候跳转到自定义界面,这样比较美观!

希望对大家有帮助
(紫罗兰永恒花园)

觉得不错的小伙伴可以右上角点个赞或关注哟!