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
This commit is contained in:
Sauhard Sharma
2019-08-13 13:57:29 +05:30
committed by Sam Brannen
parent c863b8994a
commit 91c0fbaadb

View File

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