URI 連接工具
UriComponents 對象
UriComponents uriComponents =
UriComponentsBuilder
.fromUriString("https://example.com/hotels/{hotel}")
.queryParam("q", "{q}")
.encode()
.build();
URI uri = uriComponents.expand("Westin", "123").toUri();簡化版
URI uri =
UriComponentsBuilder
.fromUriString("https://example.com/hotels/{hotel}")
.queryParam("q", "{q}")
.encode()
.buildAndExpand("Westin", "123")
.toUri();預設自帶 URI 編碼
URI 編碼時機
當前 Servlet 請求
Last updated