@@ -44,6 +44,11 @@ Kotlin::
44
44
----
45
45
======
46
46
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
+
47
52
The preceding example registers a number of Spring WebFlux
48
53
xref:web/webflux/dispatcher-handler.adoc#webflux-special-bean-types[infrastructure beans] and adapts to dependencies
49
54
available on the classpath -- for JSON, XML, and others.
64
69
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
65
70
----
66
71
@Configuration
67
- @EnableWebFlux
68
72
public class WebConfig implements WebFluxConfigurer {
69
73
70
74
// Implement configuration methods...
@@ -76,7 +80,6 @@ Kotlin::
76
80
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
77
81
----
78
82
@Configuration
79
- @EnableWebFlux
80
83
class WebConfig : WebFluxConfigurer {
81
84
82
85
// Implement configuration methods...
@@ -102,7 +105,6 @@ Java::
102
105
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
103
106
----
104
107
@Configuration
105
- @EnableWebFlux
106
108
public class WebConfig implements WebFluxConfigurer {
107
109
108
110
@Override
@@ -118,7 +120,6 @@ Kotlin::
118
120
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
119
121
----
120
122
@Configuration
121
- @EnableWebFlux
122
123
class WebConfig : WebFluxConfigurer {
123
124
124
125
override fun addFormatters(registry: FormatterRegistry) {
@@ -140,7 +141,6 @@ Java::
140
141
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
141
142
----
142
143
@Configuration
143
- @EnableWebFlux
144
144
public class WebConfig implements WebFluxConfigurer {
145
145
146
146
@Override
@@ -157,7 +157,6 @@ Kotlin::
157
157
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
158
158
----
159
159
@Configuration
160
- @EnableWebFlux
161
160
class WebConfig : WebFluxConfigurer {
162
161
163
162
override fun addFormatters(registry: FormatterRegistry) {
@@ -194,7 +193,6 @@ Java::
194
193
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
195
194
----
196
195
@Configuration
197
- @EnableWebFlux
198
196
public class WebConfig implements WebFluxConfigurer {
199
197
200
198
@Override
@@ -210,7 +208,6 @@ Kotlin::
210
208
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
211
209
----
212
210
@Configuration
213
- @EnableWebFlux
214
211
class WebConfig : WebFluxConfigurer {
215
212
216
213
override fun getValidator(): Validator {
@@ -279,7 +276,6 @@ Java::
279
276
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
280
277
----
281
278
@Configuration
282
- @EnableWebFlux
283
279
public class WebConfig implements WebFluxConfigurer {
284
280
285
281
@Override
@@ -294,7 +290,6 @@ Kotlin::
294
290
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
295
291
----
296
292
@Configuration
297
- @EnableWebFlux
298
293
class WebConfig : WebFluxConfigurer {
299
294
300
295
override fun configureContentTypeResolver(builder: RequestedContentTypeResolverBuilder) {
@@ -319,7 +314,6 @@ Java::
319
314
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
320
315
----
321
316
@Configuration
322
- @EnableWebFlux
323
317
public class WebConfig implements WebFluxConfigurer {
324
318
325
319
@Override
@@ -334,7 +328,6 @@ Kotlin::
334
328
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
335
329
----
336
330
@Configuration
337
- @EnableWebFlux
338
331
class WebConfig : WebFluxConfigurer {
339
332
340
333
override fun configureHttpMessageCodecs(configurer: ServerCodecConfigurer) {
@@ -376,7 +369,6 @@ Java::
376
369
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
377
370
----
378
371
@Configuration
379
- @EnableWebFlux
380
372
public class WebConfig implements WebFluxConfigurer {
381
373
382
374
@Override
@@ -391,7 +383,6 @@ Kotlin::
391
383
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
392
384
----
393
385
@Configuration
394
- @EnableWebFlux
395
386
class WebConfig : WebFluxConfigurer {
396
387
397
388
override fun configureViewResolvers(registry: ViewResolverRegistry) {
@@ -412,7 +403,6 @@ Java::
412
403
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
413
404
----
414
405
@Configuration
415
- @EnableWebFlux
416
406
public class WebConfig implements WebFluxConfigurer {
417
407
418
408
@@ -437,7 +427,6 @@ Kotlin::
437
427
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
438
428
----
439
429
@Configuration
440
- @EnableWebFlux
441
430
class WebConfig : WebFluxConfigurer {
442
431
443
432
override fun configureViewResolvers(registry: ViewResolverRegistry) {
@@ -463,7 +452,6 @@ Java::
463
452
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
464
453
----
465
454
@Configuration
466
- @EnableWebFlux
467
455
public class WebConfig implements WebFluxConfigurer {
468
456
469
457
@@ -480,7 +468,6 @@ Kotlin::
480
468
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
481
469
----
482
470
@Configuration
483
- @EnableWebFlux
484
471
class WebConfig : WebFluxConfigurer {
485
472
486
473
override fun configureViewResolvers(registry: ViewResolverRegistry) {
@@ -503,7 +490,6 @@ Java::
503
490
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
504
491
----
505
492
@Configuration
506
- @EnableWebFlux
507
493
public class WebConfig implements WebFluxConfigurer {
508
494
509
495
@@ -524,7 +510,6 @@ Kotlin::
524
510
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
525
511
----
526
512
@Configuration
527
- @EnableWebFlux
528
513
class WebConfig : WebFluxConfigurer {
529
514
530
515
@@ -565,7 +550,6 @@ Java::
565
550
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
566
551
----
567
552
@Configuration
568
- @EnableWebFlux
569
553
public class WebConfig implements WebFluxConfigurer {
570
554
571
555
@Override
@@ -583,7 +567,6 @@ Kotlin::
583
567
[source,kotlin,indent=0,subs="verbatim",role="secondary"]
584
568
----
585
569
@Configuration
586
- @EnableWebFlux
587
570
class WebConfig : WebFluxConfigurer {
588
571
589
572
override fun addResourceHandlers(registry: ResourceHandlerRegistry) {
@@ -616,7 +599,6 @@ Java::
616
599
[source,java,indent=0,subs="verbatim",role="primary"]
617
600
----
618
601
@Configuration
619
- @EnableWebFlux
620
602
public class WebConfig implements WebFluxConfigurer {
621
603
622
604
@Override
@@ -635,7 +617,6 @@ Kotlin::
635
617
[source,kotlin,indent=0,subs="verbatim",role="secondary"]
636
618
----
637
619
@Configuration
638
- @EnableWebFlux
639
620
class WebConfig : WebFluxConfigurer {
640
621
641
622
override fun addResourceHandlers(registry: ResourceHandlerRegistry) {
@@ -695,7 +676,6 @@ Java::
695
676
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
696
677
----
697
678
@Configuration
698
- @EnableWebFlux
699
679
public class WebConfig implements WebFluxConfigurer {
700
680
701
681
@Override
@@ -711,7 +691,6 @@ Kotlin::
711
691
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
712
692
----
713
693
@Configuration
714
- @EnableWebFlux
715
694
class WebConfig : WebFluxConfigurer {
716
695
717
696
@Override
@@ -756,7 +735,6 @@ Java::
756
735
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
757
736
----
758
737
@Configuration
759
- @EnableWebFlux
760
738
public class WebConfig implements WebFluxConfigurer {
761
739
762
740
@Override
@@ -772,7 +750,6 @@ Kotlin::
772
750
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
773
751
----
774
752
@Configuration
775
- @EnableWebFlux
776
753
class WebConfig : WebFluxConfigurer {
777
754
778
755
@Override
@@ -810,7 +787,6 @@ Java::
810
787
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
811
788
----
812
789
@Configuration
813
- @EnableWebFlux
814
790
public class WebConfig implements WebFluxConfigurer {
815
791
816
792
@Override
@@ -827,7 +803,6 @@ Kotlin::
827
803
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
828
804
----
829
805
@Configuration
830
- @EnableWebFlux
831
806
class WebConfig : WebFluxConfigurer {
832
807
833
808
@Override
0 commit comments