Skip to content

Commit bede619

Browse files
committed
Refine @EnableWebFlux documentation
This commit refines the documentation related to `@EnableWebFlux` in order to make it more relevant for modern Boot applications. See spring-projectsgh-22171
1 parent bf2a72b commit bede619

File tree

1 file changed

+5
-30
lines changed
  • framework-docs/modules/ROOT/pages/web/webflux

1 file changed

+5
-30
lines changed

framework-docs/modules/ROOT/pages/web/webflux/config.adoc

+5-30
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ Kotlin::
4444
----
4545
======
4646

47+
NOTE: When using Spring Boot, you may want to use `@Configuration` class of type `WebFluxConfigurer` but without
48+
`@EnableWebFlux` to keep Spring Boot WebFlux customizations. See more details in
49+
xref:#webflux-config-customize[the WebFlux config API section] and in
50+
{spring-boot-docs}/web.html#web.reactive.webflux.auto-configuration[the dedicated Spring Boot documentation].
51+
4752
The preceding example registers a number of Spring WebFlux
4853
xref:web/webflux/dispatcher-handler.adoc#webflux-special-bean-types[infrastructure beans] and adapts to dependencies
4954
available on the classpath -- for JSON, XML, and others.
@@ -64,7 +69,6 @@ Java::
6469
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
6570
----
6671
@Configuration
67-
@EnableWebFlux
6872
public class WebConfig implements WebFluxConfigurer {
6973
7074
// Implement configuration methods...
@@ -76,7 +80,6 @@ Kotlin::
7680
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
7781
----
7882
@Configuration
79-
@EnableWebFlux
8083
class WebConfig : WebFluxConfigurer {
8184
8285
// Implement configuration methods...
@@ -102,7 +105,6 @@ Java::
102105
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
103106
----
104107
@Configuration
105-
@EnableWebFlux
106108
public class WebConfig implements WebFluxConfigurer {
107109
108110
@Override
@@ -118,7 +120,6 @@ Kotlin::
118120
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
119121
----
120122
@Configuration
121-
@EnableWebFlux
122123
class WebConfig : WebFluxConfigurer {
123124
124125
override fun addFormatters(registry: FormatterRegistry) {
@@ -140,7 +141,6 @@ Java::
140141
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
141142
----
142143
@Configuration
143-
@EnableWebFlux
144144
public class WebConfig implements WebFluxConfigurer {
145145
146146
@Override
@@ -157,7 +157,6 @@ Kotlin::
157157
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
158158
----
159159
@Configuration
160-
@EnableWebFlux
161160
class WebConfig : WebFluxConfigurer {
162161
163162
override fun addFormatters(registry: FormatterRegistry) {
@@ -194,7 +193,6 @@ Java::
194193
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
195194
----
196195
@Configuration
197-
@EnableWebFlux
198196
public class WebConfig implements WebFluxConfigurer {
199197
200198
@Override
@@ -210,7 +208,6 @@ Kotlin::
210208
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
211209
----
212210
@Configuration
213-
@EnableWebFlux
214211
class WebConfig : WebFluxConfigurer {
215212
216213
override fun getValidator(): Validator {
@@ -279,7 +276,6 @@ Java::
279276
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
280277
----
281278
@Configuration
282-
@EnableWebFlux
283279
public class WebConfig implements WebFluxConfigurer {
284280
285281
@Override
@@ -294,7 +290,6 @@ Kotlin::
294290
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
295291
----
296292
@Configuration
297-
@EnableWebFlux
298293
class WebConfig : WebFluxConfigurer {
299294
300295
override fun configureContentTypeResolver(builder: RequestedContentTypeResolverBuilder) {
@@ -319,7 +314,6 @@ Java::
319314
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
320315
----
321316
@Configuration
322-
@EnableWebFlux
323317
public class WebConfig implements WebFluxConfigurer {
324318
325319
@Override
@@ -334,7 +328,6 @@ Kotlin::
334328
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
335329
----
336330
@Configuration
337-
@EnableWebFlux
338331
class WebConfig : WebFluxConfigurer {
339332
340333
override fun configureHttpMessageCodecs(configurer: ServerCodecConfigurer) {
@@ -376,7 +369,6 @@ Java::
376369
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
377370
----
378371
@Configuration
379-
@EnableWebFlux
380372
public class WebConfig implements WebFluxConfigurer {
381373
382374
@Override
@@ -391,7 +383,6 @@ Kotlin::
391383
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
392384
----
393385
@Configuration
394-
@EnableWebFlux
395386
class WebConfig : WebFluxConfigurer {
396387
397388
override fun configureViewResolvers(registry: ViewResolverRegistry) {
@@ -412,7 +403,6 @@ Java::
412403
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
413404
----
414405
@Configuration
415-
@EnableWebFlux
416406
public class WebConfig implements WebFluxConfigurer {
417407
418408
@@ -437,7 +427,6 @@ Kotlin::
437427
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
438428
----
439429
@Configuration
440-
@EnableWebFlux
441430
class WebConfig : WebFluxConfigurer {
442431
443432
override fun configureViewResolvers(registry: ViewResolverRegistry) {
@@ -463,7 +452,6 @@ Java::
463452
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
464453
----
465454
@Configuration
466-
@EnableWebFlux
467455
public class WebConfig implements WebFluxConfigurer {
468456
469457
@@ -480,7 +468,6 @@ Kotlin::
480468
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
481469
----
482470
@Configuration
483-
@EnableWebFlux
484471
class WebConfig : WebFluxConfigurer {
485472
486473
override fun configureViewResolvers(registry: ViewResolverRegistry) {
@@ -503,7 +490,6 @@ Java::
503490
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
504491
----
505492
@Configuration
506-
@EnableWebFlux
507493
public class WebConfig implements WebFluxConfigurer {
508494
509495
@@ -524,7 +510,6 @@ Kotlin::
524510
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
525511
----
526512
@Configuration
527-
@EnableWebFlux
528513
class WebConfig : WebFluxConfigurer {
529514
530515
@@ -565,7 +550,6 @@ Java::
565550
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
566551
----
567552
@Configuration
568-
@EnableWebFlux
569553
public class WebConfig implements WebFluxConfigurer {
570554
571555
@Override
@@ -583,7 +567,6 @@ Kotlin::
583567
[source,kotlin,indent=0,subs="verbatim",role="secondary"]
584568
----
585569
@Configuration
586-
@EnableWebFlux
587570
class WebConfig : WebFluxConfigurer {
588571
589572
override fun addResourceHandlers(registry: ResourceHandlerRegistry) {
@@ -616,7 +599,6 @@ Java::
616599
[source,java,indent=0,subs="verbatim",role="primary"]
617600
----
618601
@Configuration
619-
@EnableWebFlux
620602
public class WebConfig implements WebFluxConfigurer {
621603
622604
@Override
@@ -635,7 +617,6 @@ Kotlin::
635617
[source,kotlin,indent=0,subs="verbatim",role="secondary"]
636618
----
637619
@Configuration
638-
@EnableWebFlux
639620
class WebConfig : WebFluxConfigurer {
640621
641622
override fun addResourceHandlers(registry: ResourceHandlerRegistry) {
@@ -695,7 +676,6 @@ Java::
695676
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
696677
----
697678
@Configuration
698-
@EnableWebFlux
699679
public class WebConfig implements WebFluxConfigurer {
700680
701681
@Override
@@ -711,7 +691,6 @@ Kotlin::
711691
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
712692
----
713693
@Configuration
714-
@EnableWebFlux
715694
class WebConfig : WebFluxConfigurer {
716695
717696
@Override
@@ -756,7 +735,6 @@ Java::
756735
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
757736
----
758737
@Configuration
759-
@EnableWebFlux
760738
public class WebConfig implements WebFluxConfigurer {
761739
762740
@Override
@@ -772,7 +750,6 @@ Kotlin::
772750
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
773751
----
774752
@Configuration
775-
@EnableWebFlux
776753
class WebConfig : WebFluxConfigurer {
777754
778755
@Override
@@ -810,7 +787,6 @@ Java::
810787
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
811788
----
812789
@Configuration
813-
@EnableWebFlux
814790
public class WebConfig implements WebFluxConfigurer {
815791
816792
@Override
@@ -827,7 +803,6 @@ Kotlin::
827803
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
828804
----
829805
@Configuration
830-
@EnableWebFlux
831806
class WebConfig : WebFluxConfigurer {
832807
833808
@Override

0 commit comments

Comments
 (0)