参考自 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的AOP开发入门,Spring整合Junit单元测试(基于ASpectJ的XML方式)

除此之外,Spring要整合Junit单元测试的话,还需引入

Spring的AOP开发入门,Spring整合Junit单元测试(基于ASpectJ的XML方式)

 

引入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();
}
View Code

相关文章:

  • 2021-06-10
  • 2021-08-23
  • 2021-09-23
  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-19
  • 2021-10-07
  • 2021-10-20
  • 2022-12-23
  • 2021-04-28
  • 2021-04-20
相关资源
相似解决方案