Failed to bind request element: 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: "on"
表单提交时,有个字段类型为字符串(不可转int的字符串),后台用的Integer接收,把Integer换成String即可
END
本文解决了一个表单提交时字段类型不匹配的问题,原本后台期望接收Integer类型的数据,但前端提交的是无法转换为整数的字符串,导致了MethodArgumentTypeMismatchException异常。解决方案是将后台接收类型从Integer改为String。

7379

被折叠的 条评论
为什么被折叠?



