> For the complete documentation index, see [llms.txt](https://jack80342.gitbook.io/spring-boot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jack80342.gitbook.io/spring-boot/iv.-spring-boot-features/27.-developing-web-applications/27.2-the-spring-webflux-framework/27.2.1-spring-webflux-auto-configuration.md).

# 27.2.1 Spring WebFlux自动配置

Spring Boot为Spring WebFlux提供了自动配置。这些配置在大多数应用里能够很好地工作。

自动配置会添加以下特性：

* 为`HttpMessageReader`和`HttpMessageWriter`实例配置编解码器([在此文档的后面章节](https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#boot-features-webflux-httpcodecs)有描述)。
* 支持服务静态内容，包括对WebJars的支持 ([在此文档的后面章节](https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#boot-features-spring-mvc-static-content)有描述)。

如果你想保持Spring Boot WebFlux特性，并添加额外的[WebFlux配置](https://docs.spring.io/spring/docs/5.0.4.RELEASE/spring-framework-reference/web.html#web-reactive)，你可以添加你自己的`WebFluxConfigurer`类型的`@Configuration`类，但是不加`@EnableWebFlux`。

如果你想完全控制Spring WebFlux，你可以添加你自己的`@Configuration`，并用`@EnableWebFlux`标注。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://jack80342.gitbook.io/spring-boot/iv.-spring-boot-features/27.-developing-web-applications/27.2-the-spring-webflux-framework/27.2.1-spring-webflux-auto-configuration.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
