1.applicationContext文件配置
<?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:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd">
<!-- 自动扫描-->
<context:component-scan base-package="com.liuyu.service"/>
<!-- 手动配置(与自动扫描二选一)-->
<!-- <bean id="someServiceImpl" class="com.liuyu.service.serviceImpl.SomeServiceImpl"></bean>-->
<!-- 导入其他xml-->
<import resource="classpath:spring-person.xml"/>
<!-- aop代理类注册-->
<bean id="aspect1" class="com.liuyu.aspect.Aspect1"/>
<!-- 自动代理生成器-->
<aop:aspectj-autoproxy/>
</beans>