I'm trying to define a bean.
<bean id="prop1" class="Prop1"/>
<bean id="myBean" class="myClass">
<property name="prop2">
<bean class="Prop2">
</property>
</bean>
Now I have this class
public class myClass(){
@Autowired
private Prop1 prop1;
private Prop2 prop2;
public setProp2(Prop2 prop2){
this.prop2 = prop2;
}
...
}
Im aware that I can just add property to myBean bean but I am trying to avoid that. Right now im getting null on prop1. Is it possible to initialized prop1
? If not please explain or give me a link to read about this.
TIA