Browse Source

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
pull/23470/head
Sauhard Sharma 7 years ago committed by Sam Brannen
parent
commit
91c0fbaadb
  1. 11
      spring-webflux/src/main/java/org/springframework/web/reactive/config/EnableWebFlux.java

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

@ -47,10 +47,17 @@ import org.springframework.context.annotation.Import;
* @EnableWebFlux * @EnableWebFlux
* @ComponentScan(basePackageClasses = MyConfiguration.class) * @ComponentScan(basePackageClasses = MyConfiguration.class)
* public class MyConfiguration implements WebFluxConfigurer { * public class MyConfiguration implements WebFluxConfigurer {
*
* private ObjectMapper objectMapper;
* *
* @Override * @Override
* public void configureMessageWriters(List<HttpMessageWriter<?&gt&gt messageWriters) { * public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
* messageWriters.add(new MyHttpMessageWriter()); * configurer.defaultCodecs().jackson2JsonEncoder(
* new Jackson2JsonEncoder(objectMapper)
* );
* configurer.defaultCodecs().jackson2JsonDecoder(
* new Jackson2JsonDecoder(objectMapper)
* );
* } * }
* *
* // ... * // ...

Loading…
Cancel
Save