求问大佬们,SSm 前端传Date参数到后台接收报错问题

boomm1 2019-08-18 10:23:28
org.springframework.validation.BeanPropertyBindingResult: 1 errors

Field error in object 'cstService' on field 'svr_create_date': rejected value [2019-08-14]; codes

[typeMismatch.cstService.svr_create_date,typeMismatch.svr_create_date,typeMismatch.java.util.Date,typeMismatch]; arguments

[org.springframework.context.support.DefaultMessageSourceResolvable: codes [cstService.svr_create_date,svr_create_date];

arguments []; default message [svr_create_date]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'svr_create_date'; nested exception is

org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type

@org.springframework.format.annotation.DateTimeFormat java.util.Date for value '2019-08-14'; nested exception is

java.lang.IllegalArgumentException: Invalid format: "2019-08-14" is too short]
...全文
456 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
编程写手 2019-08-19
  • 打赏
  • 举报
回复
你的值短了,加上时分秒试试,不行就创建日期类型转换器
weixin_43869905 2019-08-19
  • 打赏
  • 举报
回复
加我 帮你调试 秋秋 985756853

62,628

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧