HTTP Status 400 The request sent by the client was syntactically incorrect.

来源:互联网 发布:nginx 403 编辑:程序博客网 时间:2024/05/06 14:54

出现这个问题的主要原因主要是请求传入参数和接收对象的参数不一致(有可能是名字不一致,也有可能是参数的类型不一致)

下面的信息是我把log4j的org.springframework.web=bug才打印出来的,看到这个信息之后就迎刃而解了


org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 2 errors
Field error in object 'institutionBase' on field 'licenceUrl': rejected value [org.springframework.web.multipart.commons.CommonsMultipartFile@ddbecad]; codes [typeMismatch.institutionBase.licenceUrl,typeMismatch.licenceUrl,typeMismatch.java.lang.String,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [institutionBase.licenceUrl,licenceUrl]; arguments []; default message [licenceUrl]]; default message [Failed to convert property value of type [org.springframework.web.multipart.commons.CommonsMultipartFile] to required type [java.lang.String] for property 'licenceUrl'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.web.multipart.commons.CommonsMultipartFile] to required type [java.lang.String] for property 'licenceUrl': no matching editors or conversion strategy found]
Field error in object 'institutionBase' on field 'licencePath': rejected value [org.springframework.web.multipart.commons.CommonsMultipartFile@618f58f6]; codes [typeMismatch.institutionBase.licencePath,typeMismatch.licencePath,typeMismatch.java.lang.String,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [institutionBase.licencePath,licencePath]; arguments []; default message [licencePath]]; default message [Failed to convert property value of type [org.springframework.web.multipart.commons.CommonsMultipartFile] to required type [java.lang.String] for property 'licencePath'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.springframework.web.multipart.commons.CommonsMultipartFile] to required type [java.lang.String] for property 'licencePath': no matching editors or conversion strategy found]

0 0
原创粉丝点击