1. 程式人生 > >Spring的Controller請求方法中引數名匹配,但是引數型別不同會報404

Spring的Controller請求方法中引數名匹配,但是引數型別不同會報404

org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'merchantAppInfo' on field 'status': rejected value [a]; codes [typeMismatch.merchantAppInfo.status,typeMismatch.status,typeMismatch.java.lang.Integer,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [merchantAppInfo.status,status]; arguments []; default message [status]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.lang.Integer' for property 'status'; nested exception is java.lang.NumberFormatException: For input string: "a"]