struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emi Lu <>
Subject Struts2 + Spring + ibatis configuration set in applicationContext-ibatis.xml
Date Wed, 16 Dec 2009 21:43:58 GMT
Hello list,

Struts2 + Spring + ibatis, database connection configuration question:

(1) In applicationContext-ibatis.xml

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" 
    <property name="driverClassName" value="${driverClassName}" />
    <property name="url"      value="${url}" />
    <property name="username" value="${username}" />
    <property name="password" value="${password}" />

<bean id="sqlMapClient" 
    <property name="dataSource">
       <ref local="dataSource" />

    <property name="configLocation" 
value="WEB-INF/classes/sqlMapConfig.xml" />

My question is in each my action class, do I have to define as the 
<bean id="client1" class="ActionClass1">
       <property name="sqlMapClient" ref="sqlMapClient" />

<bean id="client2" class="ActionClass2">
       <property name="sqlMapClient" ref="sqlMapClient" />


<bean id="clientN" class="ActionClassN">
       <property name="sqlMapClient" ref="sqlMapClient" />

So for each my action class I have to define one bean? Is it true or 
there are other simple ways?

Thanks a lot!

Lu Ying

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message