現象
使用BeanUtils復制對象屬性,結果拋出No value specified for Date異常。
原因
是數據源orig有一個參數是java.util.Date類型,沒有初始化值,調用了BeanUtils.copyProperties方法。
解決辦法
在使用方法之前執行
1 ConvertUtils.register(new DateConverter(null), java.util.Date.class);
完美解決。
現象
使用BeanUtils復制對象屬性,結果拋出No value specified for Date異常。
原因
是數據源orig有一個參數是java.util.Date類型,沒有初始化值,調用了BeanUtils.copyProperties方法。
解決辦法
在使用方法之前執行
1 ConvertUtils.register(new DateConverter(null), java.util.Date.class);
完美解決。
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。