由于公司业务条例要求,在传参时以Map形式JSON字符串传参
而在使用apache.commons.BeanUtils工具类将Map转为javaBean时,出现了将javaBean中的Integer 类型的属性转为了0而不是null的情况
通过断点调试后发现 BeanUtils工具类在将""转为Integer时,默认值为0
解决方案:1、如果字段为""时不传该字段,
2:设置一下 默认Converter
使用 ConvertUtils.register(new IntegerConvert(null),Integer.class)
此时该问题可解决,以此记录,也给自己长个记性