Add UriComponentsBuilder.clone() [SPR-12494] #17100
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Hendy Irawan opened SPR-12494 and commented
In Spring MVC it's possible to inject
UriComponentsBuilder
into a@RestController
method, making building links convenient.However, when crafting a hypermedia response, there needs to be many links, some of them may refer to different places.
Calling
.replacePath()
(or any method) will mutate theUriComponentsBuilder
, rendering it somewhat useless for next invocations. Also, it's impossible to start "clean" (from state of injection).Please add
clone()
so it's easy for this use case.Affects: 4.1.2
Referenced from: commits 189ec75
The text was updated successfully, but these errors were encountered: