我有一个豆子:
<bean id="BasketLogic" class="efco.logic.EfcoBasketLogic" autowire="byType">
<property name="documentLogic" ref="DocumentLogic" />
<property name="stateAccess" ref="StateAccess" />
<property name="contextAccess" ref="ContextAccess" />
</bean>
<bean id="EfcoErpService" autowire="byType" class="efco.erp.service.EfcoErpServiceImpl">
<constructor-arg ref="ErpConnector"/>
</bean>
documentLogic、stateAccess和contextAccess是BasketLogicImpl上的字段
而我没有<context:component-scan />
EfcoBasketLogic.java:
public class EfcoBasketLogic extends BasketLogicImpl {
@Inject
private EfcoErpService erpService;
...
...
...
}
erpService 是null,除非我提供了一个设置器。但为什么?我认为在进行自动装配的地方不需要二传手?会不会是 BasketLogicImpl 对此负责?