org.springframework.beans.factory.InitializingBean

TestDaoFactory

public class TestDaoFactory implements InitializingBean{

public void setDaoList(List<GenericDao> list)
{
daoList = list;
}

}

servlet.xml

<bean id="daoFactory" class="com.xxx.www.TestDaoFactory">
<property name="daoList">
<list>
<bean class="com.xxx.MMM">
<property name="yyy" ref="zzz" />
<property name="kkk">
<list>
<bean class="com.xxx.www.AAA />
</list>
</property>
</bean>
</list>
</property>
</bean>

ref : http://www.mkyong.com/spring/spring-initializingbean-and-disposablebean-example/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s