Fix code example callouts in reference manual

This commit is contained in:
Sam Brannen
2022-11-29 13:54:10 +01:00
parent 6af94dffe5
commit c2b16f1ffb
7 changed files with 59 additions and 0 deletions

View File

@@ -5144,6 +5144,7 @@ Controllers can add explicit support for HTTP caching. We recommended doing so,
against conditional request headers. A controller can add an `ETag` header and `Cache-Control`
settings to a `ResponseEntity`, as the following example shows:
--
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java
----
@@ -5176,6 +5177,7 @@ settings to a `ResponseEntity`, as the following example shows:
.body(book)
}
----
--
The preceding example sends a 304 (NOT_MODIFIED) response with an empty body if the comparison
to the conditional request headers indicates that the content has not changed. Otherwise, the
@@ -5184,6 +5186,7 @@ to the conditional request headers indicates that the content has not changed. O
You can also make the check against conditional request headers in the controller,
as the following example shows:
--
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java
----
@@ -5223,6 +5226,7 @@ as the following example shows:
<1> Application-specific calculation.
<2> The response has been set to 304 (NOT_MODIFIED) -- no further processing.
<3> Continue with the request processing.
--
There are three variants for checking conditional requests against `eTag` values, `lastModified`