|
对于最新稳定版本,请使用 Spring Boot 4.0.4! |
面向方面编程
Spring Boot 为面向方面的编程(AOP)提供了自动配置。 您可以在 Spring 框架参考文档 中了解有关 Spring AOP 的更多信息。
默认情况下,Spring Boot 的自动配置会使用 CGLib 代理来配置 Spring AOP。
要改为使用 JDK 代理,请将 spring.aop.proxy-target-class 设置为 false。
如果 AspectJ 在类路径上,Spring Boot 的自动配置将自动启用 AspectJ 自动代理,因此不需要 @EnableAspectJAutoProxy。