0
点赞
收藏
分享

微信扫一扫

springboot 异常 - Failed to convert value of type

星河出山 2022-06-24 阅读 50

Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.lang.Integer'; nested exception is java.lang.NumberFormatException: For input string: "50.5"]

大致意思:
未能将类型“java.lang.String”的值转换为所需类型“java.lang.Integer”;嵌套异常为java.lang.NumberFormatException:对于输入字符串:“50.5”]

这种错误一般是前端传的参数,后端解析失败,造成的,也就是穿的是非法参数,比如上边前端给我一个浮点数,后端在字符串解析为数字的时候,就会解析失败!


举报

相关推荐

0 条评论