宝慕林0597717
2018-01-30 17:10
新增和修改报错!
哦 你这个是houseTime的类型写错了, 要使用java.sql.Date, 你现在应该是java.util.Date.
这个错误在SpringMVC里很常见
把后台的错误日志打出来呗 ( ̄▽ ̄)"
加上@DateTimeFormat(pattern = "yyyy-MM-dd")可以解决问题
实际开发中,id肯定设置为int,自增
id字段设置的是varchar,怎么实现的自增,很好奇
guns开源项目代码生成,实体类中是java.util.Date,改成java.sql.Date即可
老师你好 我也遇到了这个问题 但是没有找到dao类 请问在那个文件中呢
666666666
2018-01-31 11:06:11.370 WARN 4748 --- [nio-8080-exec-3] .w.s.m.s.DefaultHandlerExceptionResolver : Resolved exception caused by Handler execution: org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'tblHouse' on field 'houseTime': rejected value [2018-01-11]; codes [typeMismatch.tblHouse.houseTime,typeMismatch.houseTime,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [tblHouse.houseTime,houseTime]; arguments []; default message [houseTime]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'houseTime'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@com.baomidou.mybatisplus.annotations.TableField java.util.Date] for value '2018-01-11'; nested exception is java.lang.IllegalArgumentException]
Field error in object 'tblHouse' on field 'houseTime': rejected value [2018-01-10]; codes [typeMismatch.tblHouse.houseTime,typeMismatch.houseTime,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [tblHouse.houseTime,houseTime]; arguments []; default message [houseTime]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'houseTime'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@com.baomidou.mybatisplus.annotations.TableField java.util.Date] for value '2018-01-10'; nested exception is java.lang.IllegalArgumentException]
基于SpringBoot 十分钟搞定后台管理平台
42417 学习 · 201 问题
相似问题