BeanUtils.setProperty抛出值为NULL的异常



我使用org.apache.commons.beanutils.BeanUtils.setProperty(bean,名称,值)。当该值为NULL时,将抛出异常。深入类内部,导致异常的是ConverterUtilsBean。转换方法,更具体地说是BigDecimalConverter。转换不接受null。我怎样才能克服这个问题呢?

提前感谢。致以最亲切的问候。

ConvertUtilsBean convertUtilsBean = BeanUtilsBean.getInstance().getConvertUtils();
convertUtilsBean.register(false, true, -1);

BeanUtils复制属性:注册ConvertUtils

看看这个帖子!

最新更新