springmvc-- Failed to convert property value of type 'java.lang.String' to required type

springmvc 异常:

11:11:01.655 [http-apr-8080-exec-10] DEBUG o.s.w.s.m.a.AnnotationMethodHandlerExceptionResolver - Resolving exception from handler [com.mtl.springmvc.crud.handlers.EmployeeHandler@76e86c03]: org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'employee' on field 'department': rejected value [102]; codes [typeMismatch.employee.department,typeMismatch.department,typeMismatch.com.mtl.springmvc.crud.entity.Department,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [employee.department,department]; arguments []; default message [department]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'com.mtl.springmvc.crud.entity.Department' for property 'department'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [com.mtl.springmvc.crud.entity.Department] for property 'department': no matching editors or conversion strategy found]


原因:

springmvc-- Failed to convert property value of type 'java.lang.String' to required type_第1张图片

你可能感兴趣的:(springmvc-- Failed to convert property value of type 'java.lang.String' to required type)