springmvc在提交表单时报错,具体报错如下:
Field error in object 'financeDetailed' on field 'actionDate': rejected value [2016-02-22]; codes [typeMismatch.financeDetailed.actionDate,typeMismatch.actionDate,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [financeDetailed.actionDate,actionDate]; arguments []; default message [actionDate]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'actionDate'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [java.util.Date] for property 'actionDate': no matching editors or conversion strategy found]] with root cause
org.springframework.validation.BindException: org.springframework.validation.BeanPropertyBindingResult: 1 errors
以上错误主要原因是,springmvc的controller把date类型当成string了,要解决Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date'的问题,可以参考本站的以下文章: