Spring父类属性无法注入
配置文件:
父类:
<bean id="baseServiceSupport" class="com.xpith.struts.action.BaseServiceSupport"
scope="prototype">
<property name="applicationsService">
<ref bean="applicationsService" />
</property>
</bean>
子类:
<bean id="user" class="com.xpith.struts.action.UserAction" scope="prototype"
parent="baseServiceSupport">
<property name="membersService">
<ref bean="membersService" />
</property>
</bean>
父类属性:
………………………………………………………………
protected ApplicationsService applicationsService;
…………………………………………………………………
public void setApplicationsService(ApplicationsService applicationsService) {
this.applicationsService = applicationsService;
}
子类属性:
public class UserAction extends BaseServiceSupport {
private MembersService membersService;
public void setMembersService(MembersService membersService) {
this.membersService = membersService;
}
}
在父类中,抛出applicationsService异常,判断applicationsService == null 为真~~为什么会这样呢?