Spring Framework

You have implemented a setter method "public void setFortuneService(FortuneService fortuneService)" for dependency setter injection. Write the according applicationContext.xml file.

 
<bean id="myFortuneService" class="com.company.HappyFortuneService">
</bean>
 
<bean id="myCoach" class="com.company.BaseballCoach">
        <property name="fortuneService" ref="myFortuneService"/>
</bean>

Diskussion