第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

關(guān)于spplicationContext.xml里面類的配置簡(jiǎn)化問題

因?yàn)槊恳粋€(gè)實(shí)體類都要在spplicationContext.xml中配置Action的類,配置Service,配置DAO類。有沒有注解的方式或者其他方式,有代碼的可以貼一下

正在回答

1 回答

有使用注解的不?

<!-- 配置Action由spring自動(dòng)創(chuàng)建 -->

<bean id="employeeAction" class="com.muke.employee.action.EmployeeAction" scope="prototype">

<property name="employeeService" ref="employeeService"/>

<property name="departmentService" ref="departmentService"/>

</bean>

<bean id="departmentAction" class="com.muke.employee.action.DepartmentAction" scope="prototype">

<property name="departmentService" ref="departmentService"/>

</bean>

<!-- 配置業(yè)務(wù)層的類 -->

<bean id="employeeService" class="com.muke.employee.service.impl.EmployeeServiceImpl">

<property name="employeeDao" ref="employeeDao"/>

</bean>

<bean id="departmentService" class="com.muke.employee.service.impl.DepartmentServiceImpl">

<property name="departmentDao" ref="departmentDao"/>

</bean>

<!-- 配置DAO的類 -->

<bean id="employeeDao" class="com.muke.employee.dao.impl.EmployeeDaoImpl">

<property name="sessionFactory" ref="sessionFactory"/>

</bean>

<bean id="departmentDao" class="com.muke.employee.dao.impl.DepartmentDaoImpl">

<property name="sessionFactory" ref="sessionFactory"/>

</bean>


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

關(guān)于spplicationContext.xml里面類的配置簡(jiǎn)化問題

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)