@Nullable open fun removePathExtension(): String
Remove any path extension from the requestURI. This method must be invoked before any calls to #path(String) or #pathSegment(String...).
GET http://foo.com/rest/books/6.json ServletUriComponentsBuilder builder = ServletUriComponentsBuilder.fromRequestUri(this.request); String ext = builder.removePathExtension(); String uri = builder.path("/pages/1.{ext}").buildAndExpand(ext).toUriString(); assertEquals("http://foo.com/rest/books/6/pages/1.json", result);
Return
the removed path extension for possible re-use, or null
Since
4.0