spring 中,能不能为抽象类注入属性?
<beanid="aacVerify"class="com.yinbo.jhtpay.service.merchant.autoquerycheck.AutoAccoun...
<bean id="aacVerify" class="com.yinbo.jhtpay.service.merchant.autoquerycheck.AutoAccountCheckVerify">
<property name="commonDAO" ref="CommonDAO"></property>
</bean>
<bean id="autoAccountQuery" class="com.yinbo.jhtpay.service.merchant.autoquerycheck.AutoAccountQuery" abstract="true">
<property name="checkUtils" ref="aacVerify"></property>
</bean>
下面是抽象类
public abstract class AutoAccountQuery {
private AutoAccountCheckVerify checkUtils;
有set方法,为啥每次进来这个类,checkUtils都为空?
但有解决办法撒,将CommonDAO 注入它的子类就行了撒 展开
<property name="commonDAO" ref="CommonDAO"></property>
</bean>
<bean id="autoAccountQuery" class="com.yinbo.jhtpay.service.merchant.autoquerycheck.AutoAccountQuery" abstract="true">
<property name="checkUtils" ref="aacVerify"></property>
</bean>
下面是抽象类
public abstract class AutoAccountQuery {
private AutoAccountCheckVerify checkUtils;
有set方法,为啥每次进来这个类,checkUtils都为空?
但有解决办法撒,将CommonDAO 注入它的子类就行了撒 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询