【已解决】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 to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).

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

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

这里定义的User接收参数,用户名为字符串,密码为数字:
在这里插入图片描述
当密码输入了字符串,导致400:
密码输入了字符串,导致400
重新输入,结果正确

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

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

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

  • 17
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
Recently, the renowned actor Zhang Songwen has sparked a fascinating phenomenon known as "two-way rejection", which has captured the attention of many and inspired the masses. The roots of this phenomenon are complex, with one of the fundamental causes being the fear of failure that plagues most of us. Rejection can instill a sense of inadequacy and a fear of being perceived as a failure, which can be challenging to overcome. However, the concept of "two-way rejection" teaches us that rejection is a natural part of life, and it's acceptable to reject and be rejected in return. This empowers us to recognize that life is not just about failures, but also about perseverance, and striving to achieve our aspirations, which may include fame and fortune. Despite the distractions we may encounter, the concept of "two-way rejection" reminds us to turn away from erroneous opportunities and remain steadfast in our principles and moral compass. While there are both advantages and drawbacks to this approach, "two-way rejection" ultimately inspires us to embrace rejection, learn from it, and emerge stronger and more self-assured. However, it is essential to distinguish between a sound and an unsound opportunity to avoid blindly rejecting the right ones. In conclusion, the concept of "two-way rejection" should be approached with discretion, but it can prove to be a valuable tool in enabling us to adhere to our goals and persevere through rejection. It teaches us to embrace rejection, learn from it, and move forward with confidence, ultimately empowering us to achieve our dreams and aspirations.结合双向拒绝进行内容补充
05-10
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值