前後のデータ型が一致しない場合

856 ワード

1フロントエンドからのデータがバックエンドと一致しない場合、次のような問題が発生します.
 
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: "admin"
[nio-8089-exec-5] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved exception caused by Handler execution: 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: "admin"

解決策は、前後のデータ型をずっと使えばいいということです.
もう一つは転換です
接続は次のとおりです.
https://blog.csdn.net/gwd1154978352/article/details/75041733