搭配使用
dao层配置文件(applicationContext-dao.xml):
https://blog.csdn.net/a755199443/article/details/90272909
事务管理配置文件(applicationContext-trans.xml):
https://blog.csdn.net/a755199443/article/details/90273049
service层配置文件用于扫描service层的@Service注解
文件名:applicationContext-service.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- 扫描bean对象 -->
<context:component-scan base-package="com.csdn.service"/>
</beans>