Browse Source

Fix formatting in examples

pull/29732/head
Sam Brannen 2 years ago
parent
commit
4171e35546
  1. 10
      framework-docs/src/docs/asciidoc/data-access.adoc
  2. 36
      framework-docs/src/docs/asciidoc/web/webmvc-functional.adoc

10
framework-docs/src/docs/asciidoc/data-access.adoc

@ -1090,8 +1090,8 @@ application-specific `Exception` type by supplying an _exception pattern_ via th @@ -1090,8 +1090,8 @@ application-specific `Exception` type by supplying an _exception pattern_ via th
----
<tx:advice id="txAdvice" transaction-manager="txManager">
<tx:attributes>
<tx:method name="get*" read-only="true" rollback-for="NoProductInStockException"/>
<tx:method name="*"/>
<tx:method name="get*" read-only="true" rollback-for="NoProductInStockException"/>
<tx:method name="*"/>
</tx:attributes>
</tx:advice>
----
@ -1105,8 +1105,8 @@ unhandled `InstrumentNotFoundException`: @@ -1105,8 +1105,8 @@ unhandled `InstrumentNotFoundException`:
----
<tx:advice id="txAdvice">
<tx:attributes>
<tx:method name="updateStock" no-rollback-for="InstrumentNotFoundException"/>
<tx:method name="*"/>
<tx:method name="updateStock" no-rollback-for="InstrumentNotFoundException"/>
<tx:method name="*"/>
</tx:attributes>
</tx:advice>
----
@ -1121,7 +1121,7 @@ attendant transaction: @@ -1121,7 +1121,7 @@ attendant transaction:
----
<tx:advice id="txAdvice">
<tx:attributes>
<tx:method name="*" rollback-for="Throwable" no-rollback-for="InstrumentNotFoundException"/>
<tx:method name="*" rollback-for="Throwable" no-rollback-for="InstrumentNotFoundException"/>
</tx:attributes>
</tx:advice>
----

36
framework-docs/src/docs/asciidoc/web/webmvc-functional.adoc

@ -238,22 +238,22 @@ allows you to send Strings, or other objects as JSON. For example: @@ -238,22 +238,22 @@ allows you to send Strings, or other objects as JSON. For example:
.Java
----
public RouterFunction<ServerResponse> sse() {
return route(GET("/sse"), request -> ServerResponse.sse(sseBuilder -> {
// Save the sseBuilder object somewhere..
}));
return route(GET("/sse"), request -> ServerResponse.sse(sseBuilder -> {
// Save the sseBuilder object somewhere..
}));
}
// In some other thread, sending a String
sseBuilder.send("Hello world");
// Or an object, which will be transformed into JSON
Person person = ...
Person person = ...
sseBuilder.send(person);
// Customize the event by using the other methods
sseBuilder.id("42")
.event("sse event")
.data(person);
// Customize the event by using the other methods
sseBuilder.id("42")
.event("sse event")
.data(person);
// and done at some point
sseBuilder.complete();
@ -261,23 +261,23 @@ allows you to send Strings, or other objects as JSON. For example: @@ -261,23 +261,23 @@ allows you to send Strings, or other objects as JSON. For example:
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
fun sse(): RouterFunction<ServerResponse> = router {
GET("/sse") { request -> ServerResponse.sse { sseBuilder ->
// Save the sseBuilder object somewhere..
}
}
fun sse(): RouterFunction<ServerResponse> = router {
GET("/sse") { request -> ServerResponse.sse { sseBuilder ->
// Save the sseBuilder object somewhere..
}
}
// In some other thread, sending a String
sseBuilder.send("Hello world")
// Or an object, which will be transformed into JSON
val person = ...
val person = ...
sseBuilder.send(person)
// Customize the event by using the other methods
sseBuilder.id("42")
.event("sse event")
.data(person)
// Customize the event by using the other methods
sseBuilder.id("42")
.event("sse event")
.data(person)
// and done at some point
sseBuilder.complete()

Loading…
Cancel
Save