【发布时间】:2020-09-16 10:01:26
【问题描述】:
我有以下 SPel 表达式:
custData.address[0].postcode
custData 是现有对象,但 address 是一个空列表。它是一个现有的对象,但它是空的。当我尝试在此路径上设置邮政编码时,我得到了
org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'postcode' cannot be found on null
我需要将一个新的address 对象放入列表并设置其postcode 属性。
是不是可以在 SPel 表达式中完成?
谢谢,
五、
【问题讨论】: