# Uses of Class
org.springframework.web.util.UriComponentsBuilder

Packages that use UriComponentsBuilder
Package
Description
org.springframework.web.method.annotation
Support classes for annotation-based handler method processing.
org.springframework.web.method.support
Generic support classes for handler method processing.
org.springframework.web.util
Miscellaneous web utility classes, such as HTML escaping and cookie handling.

## Uses of UriComponentsBuilder in org.springframework.web.method.annotation

Methods in org.springframework.web.method.annotation with parameters of type UriComponentsBuilder
Modifier and Type
Method
Description
`void`
RequestParamMethodArgumentResolver.`contributeMethodArgument(org.springframework.core.MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables, org.springframework.core.convert.ConversionService conversionService)`

## Uses of UriComponentsBuilder in org.springframework.web.method.support

Methods in org.springframework.web.method.support with parameters of type UriComponentsBuilder
Modifier and Type
Method
Description
`void`
CompositeUriComponentsContributor.`contributeMethodArgument(org.springframework.core.MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables)`
An overloaded method that uses the ConversionService created at construction.
`void`
CompositeUriComponentsContributor.`contributeMethodArgument(org.springframework.core.MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables, org.springframework.core.convert.ConversionService conversionService)`
`void`
UriComponentsContributor.`contributeMethodArgument(org.springframework.core.MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables, org.springframework.core.convert.ConversionService conversionService)`
Process the given method argument and either update the `UriComponentsBuilder` or add to the map with URI variables to use to expand the URI after all arguments are processed.

## Uses of UriComponentsBuilder in org.springframework.web.util

Methods in org.springframework.web.util that return UriComponentsBuilder
Modifier and Type
Method
Description
`static UriComponentsBuilder`
ForwardedHeaderUtils.`adaptFromForwardedHeaders(URI uri, HttpHeaders headers)`
Adapt the scheme+host+port of the given `URI` from the "Forwarded" header (see RFC 7239) or from the "X-Forwarded-Host", "X-Forwarded-Port", and "X-Forwarded-Proto" headers if "Forwarded" is not present.
`UriComponentsBuilder`
UriComponentsBuilder.`cloneBuilder()`
Clone this `UriComponentsBuilder`.
`final UriComponentsBuilder`
UriComponentsBuilder.`encode()`
Request to have the URI template pre-encoded at build time, and URI variables encoded separately when expanded.
`UriComponentsBuilder`
UriComponentsBuilder.`encode(Charset charset)`
A variant of `encode()` with a charset other than "UTF-8".
`UriComponentsBuilder`
UriComponentsBuilder.`fragment(String fragment)`
`static UriComponentsBuilder`
UriComponentsBuilder.`fromHttpRequest(HttpRequest request)`
Deprecated, for removal: This API element is subject to removal in a future version.
in favor of `ForwardedHeaderUtils.adaptFromForwardedHeaders(java.net.URI, org.springframework.http.HttpHeaders)`; to be removed in 7.0
`static UriComponentsBuilder`
UriComponentsBuilder.`fromHttpUrl(String httpUrl)`
Deprecated.
as of 6.2, in favor of `fromUriString(String)`; scheduled for removal in 7.0.
`static UriComponentsBuilder`
UriComponentsBuilder.`fromOriginHeader(String origin)`
Deprecated, for removal: This API element is subject to removal in a future version.
in favor of `fromUriString(String)`; to be removed in 7.0
`static UriComponentsBuilder`
UriComponentsBuilder.`fromPath(String path)`
Create a builder that is initialized with the given path.
`static UriComponentsBuilder`
UriComponentsBuilder.`fromUri(URI uri)`
Create a builder that is initialized from the given `URI`.
`static UriComponentsBuilder`
UriComponentsBuilder.`fromUriString(String uri)`
Variant of `fromUriString(String, ParserType)` that defaults to the `UriComponentsBuilder.ParserType.RFC` parsing.
`static UriComponentsBuilder`
UriComponentsBuilder.`fromUriString(String uri, UriComponentsBuilder.ParserType parserType)`
Create a builder that is initialized by parsing the given URI string.
`UriComponentsBuilder`
UriComponentsBuilder.`host(String host)`
`static UriComponentsBuilder`
UriComponentsBuilder.`newInstance()`
Create a new, empty builder.
`UriComponentsBuilder`
UriComponentsBuilder.`path(String path)`
`UriComponentsBuilder`
UriComponentsBuilder.`pathSegment(String... pathSegments)`
`UriComponentsBuilder`
UriComponentsBuilder.`port(int port)`
`UriComponentsBuilder`
UriComponentsBuilder.`port(String port)`
`UriComponentsBuilder`
UriComponentsBuilder.`query(String query)`
`UriComponentsBuilder`
UriComponentsBuilder.`queryParam(String name, Object... values)`
`UriComponentsBuilder`
UriComponentsBuilder.`queryParam(String name, Collection<?> values)`
`UriComponentsBuilder`
UriComponentsBuilder.`queryParamIfPresent(String name, Optional<?> value)`
`UriComponentsBuilder`
UriComponentsBuilder.`queryParams(org.springframework.util.MultiValueMap<String,String> params)`
Add multiple query parameters and values.
`UriComponentsBuilder`
UriComponentsBuilder.`replacePath(String path)`
`UriComponentsBuilder`
UriComponentsBuilder.`replaceQuery(String query)`
`UriComponentsBuilder`
UriComponentsBuilder.`replaceQueryParam(String name, Object... values)`
`UriComponentsBuilder`
UriComponentsBuilder.`replaceQueryParam(String name, Collection<?> values)`
`UriComponentsBuilder`
UriComponentsBuilder.`replaceQueryParams(org.springframework.util.MultiValueMap<String,String> params)`
Set the query parameter values after removing all existing ones.
`UriComponentsBuilder`
UriComponentsBuilder.`scheme(String scheme)`
`UriComponentsBuilder`
UriComponentsBuilder.`schemeSpecificPart(String ssp)`
Set the URI scheme-specific-part.
`UriComponentsBuilder`
UriComponentsBuilder.`uri(URI uri)`
Initialize components of this builder from components of the given URI.
`UriComponentsBuilder`
UriComponentsBuilder.`uriComponents(UriComponents uriComponents)`
Set or append individual URI components of this builder from the values of the given `UriComponents` instance.
`UriComponentsBuilder`
UriComponentsBuilder.`uriVariables(Map<String,Object> uriVariables)`
Configure URI variables to be expanded at build time.
`UriComponentsBuilder`
UriComponentsBuilder.`userInfo(String userInfo)`
Methods in org.springframework.web.util with parameters of type UriComponentsBuilder
Modifier and Type
Method
Description
`protected abstract void`
UriComponents.`copyToUriComponentsBuilder(UriComponentsBuilder builder)`
Set all components of the given UriComponentsBuilder.
Constructors in org.springframework.web.util with parameters of type UriComponentsBuilder
Modifier
Constructor
Description
``
`DefaultUriBuilderFactory(UriComponentsBuilder baseUri)`
Variant of `DefaultUriBuilderFactory(String)` with a `UriComponentsBuilder`.
`protected`
`UriComponentsBuilder(UriComponentsBuilder other)`
Create a deep copy of the given UriComponentsBuilder.