今天在一个基于SSM的项目里出现以下报错 Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property 'xxx': no matching editors or conversion strategy found 报错内容大概理解,就是前端输入给后台的是一个字符串,后台需要Date类型嘛,这之间的转换出错,解决办法是: 在对应的controller中增加属性编辑器:…
内容 一.异常信息 HTTP Status 400 - type Status report message description The request sent by the client was syntactically incorrect. Apache Tomcat/7.0.37 二.解决办法 1.造成原因 SpringMVC 错误,由于前端界面传递错误参数类型给后台,后台就收参数后,转换参数类型失败导致. 2.解决 打开浏览器控制台,点击 network 查看传递的参数是什么,然…
springmvc在表单提交接收date类型参数的时候会报错:Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property 'actionDate' 一.利用spring的DateTimeFormat注解 让springmvc提交表单时正确的接收date类型参数,主要分以下3个步骤: 1.在需要由string转Date的字段上加上DateTimeFormat注解,代码如…