关于Spring的配置的
<bean id="person" class="service.Person">
<property name="axe" ref="axe"></property>
</bean>
这里的name和ref虽然是同名的但是name是指Person类中的参数,Person类中有一个Axe类型名叫axe的对象,而ref是当前xml文件中叫做axe的这个bean,把它当作参数传进Person中。
关于Spring的配置的
<bean id="person" class="service.Person">
<property name="axe" ref="axe"></property>
</bean>
这里的name和ref虽然是同名的但是name是指Person类中的参数,Person类中有一个Axe类型名叫axe的对象,而ref是当前xml文件中叫做axe的这个bean,把它当作参数传进Person中。