官方文档中有写:

You may register aspect classes as regular beans in your Spring XML configuration, or autodetect them through classpath scanning - just like any other Spring-managed bean. However, note that the @Aspect annotation is not sufficient for autodetection in the classpath: For that purpose, you need to add a separate @Component annotation (or alternatively a custom stereotype annotation that qualifies, as per the rules of Spring’s component scanner).

翻译:
您可以在Spring XML配置中注册aspect类,或者通过类路径扫描自动检测它们,就像任何其他Spring管理bean一样。但是,请注意,@aspect注释对于在类路径中自动检测是不够的:为了达到这个目的,您需要添加一个单独的@component注解(或者根据Spring的组件扫描器的规则来定义一个定制的原型注解)。
————————————————
版权声明:本文为CSDN博主「todoliang」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/woshiyigeliangliang/article/details/81450443

最新文章

  1. 作为一名前端er,从武汉来到深圳三个月有感
  2. Delphi 操作word 表格
  3. 动态添加组件(XML)
  4. 怎么让自己的java系统使用支付接口
  5. Android 巧妙实现图片和文字上下布局或者左右布局
  6. HTML5 Canvas Text实例1
  7. GUID的广泛使用
  8. ubuntu系统安装FTP
  9. C#用WebClient下载File时操作超时的问题
  10. 算法系列——huffman编码
  11. 第二节windows系统下Xshell 5软件远程访问虚拟机 Linux系统
  12. CABasicAnimation 基本动画 分类: ios技术 2015-07-16 17:10 132人阅读 评论(0) 收藏
  13. 常用校验码(奇偶校验,海明校验,CRC)学习总结
  14. Vue项目build打包部署到Tomcat后,刷新报404错误解决方案
  15. python flask里 post请求,JSON数据获取方式总结
  16. 如何使用LinkedHashMap来实现一个LruCache
  17. 【NLP】分词 新词
  18. Centos7.3安装部署Zabbix3.4.15(成功可用)
  19. jquery选择器筛选器
  20. vue项目插入视频-mp4

热门文章

  1. Python print函数详解
  2. element-ui获取用户选中项
  3. vue中设置全局的css样式
  4. asp.net core-3.应用程序部署到iis
  5. AtCoder Grand Contest 040 C - Neither AB nor BA
  6. 入手线段树 hdu1754
  7. 轻松搭建CAS 5.x系列(5)-增加密码找回和密码修改功能
  8. Java 实现简单的 RPC 框架
  9. Abp 领域事件简单实践 <三> 自定义事件
  10. edk2中子目录介绍