@EnableAspectJAutoProxy
时间: 2023-10-08 09:04:20 浏览: 117
@EnableAspectJAutoProxy is a Spring annotation that enables support for AspectJ-based annotations and aspects. It allows the Spring framework to automatically generate proxy objects for classes annotated with @Aspect and for methods annotated with AspectJ pointcut expressions. This annotation is typically used in the configuration class of a Spring application to enable AspectJ-based AOP (Aspect-Oriented Programming) support.
When @EnableAspectJAutoProxy is used, Spring will create a proxy object for each bean that is defined in the application context that has an aspect applied to it. This proxy object will intercept method calls to the target object and apply the aspect's behavior before or after the method is executed.
Overall, @EnableAspectJAutoProxy simplifies the process of using AspectJ-based AOP in a Spring application and makes it easier to apply cross-cutting concerns to your code.
阅读全文