Fix UriComponentsBuilder examples in ref docs

Closes gh-26453
This commit is contained in:
Sam Brannen
2021-01-27 15:15:40 +01:00
parent 2d29fcd0bb
commit c5284009a1
2 changed files with 28 additions and 7 deletions

View File

@@ -82,7 +82,7 @@ as the following example shows:
.build("Westin", "123")
----
You shorter it further still with a full URI template, as the following example shows:
You can shorten it further still with a full URI template, as the following example shows:
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java
@@ -94,7 +94,7 @@ You shorter it further still with a full URI template, as the following example
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
val uri = UriComponentsBuilder
val uri = UriComponentsBuilder
.fromUriString("https://example.com/hotels/{hotel}?q={q}")
.build("Westin", "123")
----
@@ -250,7 +250,7 @@ as the following example shows:
----
URI uri = UriComponentsBuilder.fromPath("/hotel list/{city}")
.queryParam("q", "{q}")
.build("New York", "foo+bar")
.build("New York", "foo+bar");
----
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
@@ -265,13 +265,13 @@ You can shorten it further still with a full URI template, as the following exam
[source,java,indent=0,subs="verbatim,quotes",role="primary"]
.Java
----
URI uri = UriComponentsBuilder.fromPath("/hotel list/{city}?q={q}")
.build("New York", "foo+bar")
URI uri = UriComponentsBuilder.fromUriString("/hotel list/{city}?q={q}")
.build("New York", "foo+bar");
----
[source,kotlin,indent=0,subs="verbatim,quotes",role="secondary"]
.Kotlin
----
val uri = UriComponentsBuilder.fromPath("/hotel list/{city}?q={q}")
val uri = UriComponentsBuilder.fromUriString("/hotel list/{city}?q={q}")
.build("New York", "foo+bar")
----