Skip to content

Commit 91c0fba

Browse files
Sauhardstarksbrannen
authored andcommitted
Use valid example in Javadoc for @EnableWebFlux
This commit modifies the class-level Javadoc for the @EnableWebFlux annotation to reference an actual method in WebFluxConfigurer. Closes gh-23457
1 parent c863b89 commit 91c0fba

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

spring-webflux/src/main/java/org/springframework/web/reactive/config/EnableWebFlux.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,17 @@
4747
* @EnableWebFlux
4848
* @ComponentScan(basePackageClasses = MyConfiguration.class)
4949
* public class MyConfiguration implements WebFluxConfigurer {
50+
*
51+
* private ObjectMapper objectMapper;
5052
*
5153
* @Override
52-
* public void configureMessageWriters(List<HttpMessageWriter<?&gt&gt messageWriters) {
53-
* messageWriters.add(new MyHttpMessageWriter());
54+
* public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
55+
* configurer.defaultCodecs().jackson2JsonEncoder(
56+
* new Jackson2JsonEncoder(objectMapper)
57+
* );
58+
* configurer.defaultCodecs().jackson2JsonDecoder(
59+
* new Jackson2JsonDecoder(objectMapper)
60+
* );
5461
* }
5562
*
5663
* // ...

0 commit comments

Comments
 (0)