# 7.6 面向切面的编程

Spring Boot 为面向切面编程（AOP）提供自动配置。[您可以在Spring 框架参考文档](https://docs.spring.io/spring-framework/reference/6.1/core/aop-api.html)中了解有关 Spring 的 AOP 的更多信息。

默认情况下，Spring Boot 的自动配置将 Spring AOP 配置为使用 CGLib 代理。要改为使用 JDK 代理，请设置`configprop:spring.aop.proxy-target-class`为`false`.

如果 AspectJ 在类路径上，Spring Boot 的自动配置将自动启用 AspectJ 自动代理，这样就不需要`@EnableAspectJAutoProxy`了。

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://doc.shiker.tech/spring-boot-can-kao-wen-dang/7.-he-xin-te-xing/7.6-mian-xiang-qie-mian-de-bian-cheng.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
