V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Newyorkcity
V2EX  ›  问与答

SpringBoot,不给注解 @Aspect 的切面类注解 @Componet,那么它用来切其它方法的 advice 方法就等同没写。。。

  •  
  •   Newyorkcity · Dec 14, 2019 · 1864 views
    This topic created in 2331 days ago, the information mentioned may be changed or developed.
    advice 方法并不是某一个具体方法,就是泛指切面中用来增强别的方法的方法。。

    就一个简单的 demo,对切点的调用是写在 @SpringBootApplication 的类的 main 函数里的。已经注解了 @EnableAspectJAutoProxy 在配置类上。。

    我看了看官方文档,也没说 @Aspect 类一定要加 @Component 啊。。而且这个类我又不需要真的实例化拿来用,给它加 @Component 注解也怪怪的。。
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2357 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 01:42 · PVG 09:42 · LAX 18:42 · JFK 21:42
    ♥ Do have faith in what you're doing.