提交 e7e5cce7 编写于 作者: S Sam Brannen

Polish contribution

See gh-23457
上级 91c0fbaa
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -34,7 +34,7 @@ import org.springframework.context.annotation.Import;
* <pre class="code">
* &#064;Configuration
* &#064;EnableWebFlux
* &#064;ComponentScan(basePackageClasses = MyConfiguration.class)
* &#064;ComponentScan
* public class MyConfiguration {
* }
* </pre>
......@@ -45,22 +45,23 @@ import org.springframework.context.annotation.Import;
* <pre class="code">
* &#064;Configuration
* &#064;EnableWebFlux
* &#064;ComponentScan(basePackageClasses = MyConfiguration.class)
* &#064;ComponentScan
* public class MyConfiguration implements WebFluxConfigurer {
*
* private ObjectMapper objectMapper;
*
* &#064;Override
* public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
* &#064;Autowired
* private ObjectMapper objectMapper;
*
* &#064;Override
* public void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
* configurer.defaultCodecs().jackson2JsonEncoder(
* new Jackson2JsonEncoder(objectMapper)
* );
* configurer.defaultCodecs().jackson2JsonDecoder(
* new Jackson2JsonDecoder(objectMapper)
* );
* }
* }
*
* // ...
* // ...
* }
* </pre>
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册