背景:springmvc4.3.2+spring4.3.2+mybatis3.4.1 当前台传递的参数有时间类型时,封装的vo对象也有对应的时间类型与之对象, 但是如果此时用对象去接收后台会报错,类型转换异常. 例子: @RequestMapping("/test5") public String test5(ResultInfo result){ Date birthday = result.getBirthday(); System.out.println(birthday); S
spring boot 前台GET请求,传递时间类型的字符串,后台无法解析,报错:Failed to convert from type [java.lang.String] to type [java.util.Date] 而POST请求,传入时间类型字符串,后台是可以解析成Date类型的. 出现这个错误,在需要接受Date类型的字符串参数的controller层中,加入: @InitBinder public void initBinder(WebDataBinder binder) { S