【毕业设计】HTTP Status 400 -type Status report message description The request sent by the client was s...

作者在测试毕设项目时遇到HTTP 400错误,通过排查发现是由于输入框的数据类型不匹配导致,具体为应输入int类型却误输入了字符串。经过调试,最终解决了这一问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  

HTTP Status 400 -

  今天晚上做毕设时想测试一下各个函数是否成功实现了,如何就在浏览器中输入action里的路径,结果发现插入一条商品的信息时,点击“提交”以后出现400,一下我就慌了,然后开始检查自己的代码和网上的是否一致,结果发现一些错误,但是改过来以后还是400,结果看控制台的信息才知道是某个输入框里要输的是int型  结果我输入的是英文,亏我还改了那么多次代码,就这个小错误花了我半个多小时!可恶~

 

控制台信息如下:

  

警告: Handler execution resulted in exception: org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'msproductinfo' on field 'merchantid': rejected value [ sd]; codes [typeMismatch.msproductinfo.merchantid,typeMismatch.merchantid,typeMismatch.int,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [msproductinfo.merchantid,merchantid]; arguments []; default message [merchantid]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'int' for property 'merchantid'; nested exception is java.lang.NumberFormatException: For input string: "sd"]

转载于:https://www.cnblogs.com/pf96HFUTER/p/10776825.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值