参考自 https://www.cnblogs.com/ltfxy/p/9882430.html
除了基本的6个Spring开发的jar包外,还要引入aop开发相关的四个jar包:
附jar包链接:链接:https://pan.baidu.com/s/1E_8NA-DcWwt9hdK-czkm9A 提取码:xq8n
除此之外,Spring要整合Junit单元测试的话,还需引入
引入Spring配置文件
引入aop开发的约束
<?xml version="1.0" encoding="UTF-8"?> <!-- ===============================引入aop开发的约束============================ --> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"> </beans>
编写目标类与实现类,并完成配置
package spring.day2_aop; public interface ProductDao { public void find(); public void save(); public void delete(); public void update(); }