Closed
Description
Kenneth DeLong opened SPR-8803 and commented
UriComponentsBuilder should have methods also to subtract and remove items from the URI. For example, I might want to take the current URL and remove the pagination parameter from the URL:
UriComponentsBuilder.parse(request).removeParameter("page").build();
Also, I might want to change the UriPath
UriComponentsBuilder.parse(request).removeParameter("page").setUriPath("/new/path").build();
The advantage of this is we might want to keep the incoming request's DNS name, port, scheme, etc. This is a portable way of constructing URLs across environments (dev/qa/staging/prod).
URLs are not always used for redirecting etc. I might need to send out an email with a link to some page on the site. I could use the above functionality to construct a URL with the correct port, scheme, etc. in a simple portable fashion.
Affects: 3.1 RC1
Issue Links:
- Add ServletUriComponentsBuilder [SPR-8823] #13465 Add ServletUriComponentsBuilder