一.異常出現原因
使用 BeanUtils.copyProperties(model,bo),數據源對象model有一個參數是java.util.Date類型,由於導入的是org.apache.commons.beanutils.BeanUtils 沒有初始化值,導致調用BeanUtils.copyProperties方法時,
報錯No value specified for Date
二.解決方法
1.在copy之前加上
ConvertUtils.register(new DateConverter(null), java.util.Date.class);
2.Import導入BeanUtils類的時候, 選擇
org.springframework.beans.BeanUtils
就OK了