【发布时间】:2013-11-13 07:05:00
【问题描述】:
我想知道如何使用 Spring Framework 将属性从 Object Source 复制到 Object Dest 并忽略空值。
我实际上是用 Apache beanutils 和这段代码
beanUtils.setExcludeNulls(true);
beanUtils.copyProperties(dest, source);
去做。但现在我需要使用 Spring。
有什么帮助吗?
非常感谢
【问题讨论】:
-
你不能把 BeanUtils 作为你的 Spring 项目类路径的一部分吗?我不认为 Spring 的 BeanUtils 以这种方式工作。