[Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'beginTime';
依照https://stackoverflow.com/questions/23702041/failed-to-convert-property-value-of-type-java-lang-string-to-required-type-java文章所说:
加上如下注解:
@DateTimeFormat(pattern = "dd/MM/yyyy")
@Temporal(TemporalType.DATE)
具体代码如下
@Data
public class WrongAnswerRecordParam extends BasicParam{
private Byte source; @NotNull(message="用户ID不能为空")
private Long userId;
private Long wrongAnswerId;
private Long wrongAnswerTagId;
private Long questionId;
private Byte taskId;
private Long groupId;
private Integer subjectId;
private String comment;
private Long tagId;
private Byte type;
private Date updateTime;
private Date createTime; @DateTimeFormat(pattern = "yyyy-MM-dd")
private Date beginTime; @DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endTime;
}
解决
[Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'beginTime';的更多相关文章
- spring mvc出现 Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'endtime'
在使用spring mvc中,绑定页面传递时间字符串数据给Date类型是出错: Failed to convert property value of type [java.lang.String] ...
- 【spring mvc】后台API查询接口,get请求,后台Date字段接收前台String类型的时间,报错default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'createDate';
后台API查询接口,get请求,后台Date字段接收前台String类型的时间筛选条件 后台接口接收 使用的实体 而createDate字段在后台实体中是Date类型 报错信息: org.spring ...
- Java 异常 Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date'
查询时发送给服务器的日期的字符串格式:yyyy-MM-dd HH:mm:ss 服务器接收到日期的字符串之后,向 MySQL 数据库发起查询时,因为没有指定日期时间格式,导致字符串数据不能正确地转换为日 ...
- Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property 'xxx': no matching editors or conversion strategy found
今天在完成项目的时候遇到了下面的异常信息: 04-Aug-2014 15:49:27.894 SEVERE [http-apr-8080-exec-5] org.apache.catalina.cor ...
- Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource] for property 'dataSource': no matching editors or conversion strategy found
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFa ...
- 解决spring mvc 上传报错,Field [] isn't an enum value,Failed to convert value of type 'java.lang.String[]' to required type '
没有选择附件,但是点击上传按钮的时候会报错. 之前不选择文件,直接上传空文件是可以的,后来不知道改了什么就不行了. 错误信息: -- :: [http--] TRACE org.springframe ...
- Failed to convert value of type 'java.lang.String' to required type 'java.time.LocalDate';
springboot jdbc查询使用LocalDate报:Failed to convert value of type 'java.lang.String' to required type 'j ...
- SpringBoot 项目启动 Failed to convert value of type 'java.lang.String' to required type 'cn.com.goldenwater.dcproj.dao.TacPageOfficePblmListDao';
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'tac ...
- 完美解决报错Failed to convert value of type 'java.lang.String' to required type 'java.util.Date'
Failed to convert value of type 'java.lang.String' to required type 'java.util.Date' 首先这个错误的意思是 前台页面 ...
- 前台传参数时间类型不匹配:type 'java.lang.String' to required type 'java.util.Date' for property 'createDate'
springMVC action接收参数: org.springframework.validation.BindException: org.springframework.validation.B ...
随机推荐
- springboot下配置多数据源
摘自: http://blog.csdn.net/wangqingqi20005/article/details/52613055
- Pycharm安装详细教程
今天小编给大家分享如何在本机上下载和安装Pycharm,具体的教程如下: 1.首先去Pycharm官网,或者直接输入网址:http://www.jetbrains.com/pycharm/downlo ...
- word2013怎样批量重设图片和大小?(转)
https://www.zhihu.com/question/52908434/answer/132934213 点击视图,宏,查看宏,任意输入一个宏名,创建,清空框内内容,复制以下代码粘贴,保存. ...
- 无法ping通自身
今日,ping localhost 超时,ping 127.0.0.1 显示一般故障.无法访问自己电脑上的tomcat.... 居然,居然是防火墙打开了,关了就好了.我勒个去!!!!
- 极域电子教室卸载或安装软件后windows7无法启用触摸板、键盘
我今天在win7上装了个极域电子教室,卸载后重启触摸板,键盘都不能用了?连口令都是用屏幕键盘来输入的.进去后看设备管理器,键盘和触摸板,前面都有黄色的告警,而且就是出现了鼠标代码为10的情况?不过吧鼠 ...
- C#--串行化与反串行化
串行化是指存储和获取磁盘文件.内存或其他地方中的对象.在串行化时,所有的实例数据都保存到存储介质上,在取消串行化时,对象会被还原,且不能与其原实例区别开来.只需给类添加Serializable属性,就 ...
- 第九周(1) Word邮件合并2
第九周(1) Word邮件合并2 教学时间 2013-4-22 教学课时 2 教案序号 15 教学目标 1.进一步掌握邮件合并的技巧和方法.2.利用邮件合并制作准考证.3.掌握在同一页生成多个记录的方 ...
- c++10进制转换为任意2-16进制数字
#include<stdio.h> #include<stdlib.h> #include<iostream> using namespace std; int m ...
- Exchanger的使用
两个线程可以交换对象的同步点.每个线程都在进入 exchange 方法时给出某个对象,并接受其他线程返回时给出的对象. 用于实现两个人之间的数据交换,每个人在完成一定的事务后想与对方交换数据,第一个先 ...
- go1.8之安装配置
说明: 之前学习过go语言(大概是0.9版本),后来更新太快,也没怎么使用,就荒废掉了,今年有项目需要用go开发,重新捡起. 这是我在学习go语言过程中整理的内容,这里记录下,也方便我以后查阅. 操作 ...