Browse Source

Polishing

pull/29516/head
Sam Brannen 2 years ago
parent
commit
bbfc39efc9
  1. 8
      framework-docs/src/docs/asciidoc/web/webflux-functional.adoc
  2. 6
      framework-docs/src/docs/asciidoc/web/webmvc.adoc

8
framework-docs/src/docs/asciidoc/web/webflux-functional.adoc

@ -98,7 +98,7 @@ as the following example shows: @@ -98,7 +98,7 @@ as the following example shows:
}
}
----
<1> Create router using Coroutines router DSL, a Reactive alternative is also available via `router { }`.
<1> Create router using Coroutines router DSL; a Reactive alternative is also available via `router { }`.
One way to run a `RouterFunction` is to turn it into an `HttpHandler` and install it
through one of the built-in <<web-reactive.adoc#webflux-httphandler, server adapters>>:
@ -300,7 +300,6 @@ ServerResponse.created(location).build() @@ -300,7 +300,6 @@ ServerResponse.created(location).build()
Depending on the codec used, it is possible to pass hint parameters to customize how the
body is serialized or deserialized. For example, to specify a https://www.baeldung.com/jackson-json-view-annotation[Jackson JSON view]:
====
[source,java,role="primary"]
.Java
----
@ -311,7 +310,6 @@ ServerResponse.ok().hint(Jackson2CodecSupport.JSON_VIEW_HINT, MyJacksonView.clas @@ -311,7 +310,6 @@ ServerResponse.ok().hint(Jackson2CodecSupport.JSON_VIEW_HINT, MyJacksonView.clas
----
ServerResponse.ok().hint(Jackson2CodecSupport.JSON_VIEW_HINT, MyJacksonView::class.java).body(...)
----
====
[[webflux-fn-handler-classes]]
@ -525,8 +523,8 @@ header: @@ -525,8 +523,8 @@ header:
----
val route = coRouter {
GET("/hello-world", accept(TEXT_PLAIN)) {
ServerResponse.ok().bodyValueAndAwait("Hello World")
}
ServerResponse.ok().bodyValueAndAwait("Hello World")
}
}
----

6
framework-docs/src/docs/asciidoc/web/webmvc.adoc

@ -3559,8 +3559,6 @@ to the model, as the following example shows: @@ -3559,8 +3559,6 @@ to the model, as the following example shows:
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
import org.springframework.ui.set
@Controller
class UserController : AbstractController() {
@ -4792,7 +4790,7 @@ are written to the Reactor `Context` as key-value pairs, using the key assigned @@ -4792,7 +4790,7 @@ are written to the Reactor `Context` as key-value pairs, using the key assigned
For other asynchronous handling scenarios, you can use the Context Propagation library
directly. For example:
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
[source,java,indent=0,subs="verbatim,quotes"]
.Java
----
// Capture ThreadLocal values from the main thread ...
@ -5914,7 +5912,6 @@ The MVC namespace provides dedicated elements. The following example works with @@ -5914,7 +5912,6 @@ The MVC namespace provides dedicated elements. The following example works with
[source,xml,indent=0,subs="verbatim,quotes"]
----
<mvc:view-resolvers>
<mvc:content-negotiation>
<mvc:default-views>
@ -5927,7 +5924,6 @@ The MVC namespace provides dedicated elements. The following example works with @@ -5927,7 +5924,6 @@ The MVC namespace provides dedicated elements. The following example works with
<mvc:freemarker-configurer>
<mvc:template-loader-path location="/freemarker"/>
</mvc:freemarker-configurer>
----
In Java configuration, you can add the respective `Configurer` bean,

Loading…
Cancel
Save