0
我有一個Spring bean:碧玉中使用Spring豆報告
<bean
id="my.package.CustomerWrapper"
class="my.package.CustomerWrapper">
<property name="customerWrapperCache" ref="customerWrapperCache"></property>
</bean>
而且在JRXML:
<variable name="a_Info" class="java.lang.String" resetType="None">
<variableExpression><![CDATA[my.package.CustomerWrapper.lookupWithMainAddress($P{cust_id}, "informationLine")]]></variableExpression>
</variable>
但這是拋出一個NullPointerException因爲customerWrapperCache爲空。
這樣做的正確方法是什麼?