类的使用
org.springframework.web.util.UriComponentsBuilder
使用UriComponentsBuilder的程序包 程序包 说明 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.servlet.mvc.method.annotation MVC infrastructure for annotation-based handler method processing, building on theorg.springframework.web.method.annotation
package.org.springframework.web.servlet.support Support classes for Spring's web MVC framework.org.springframework.web.util Miscellaneous web utility classes, such as HTML escaping, Log4j initialization, and cookie handling.org.springframework.web.method.annotation中UriComponentsBuilder的使用
参数类型为UriComponentsBuilder的org.springframework.web.method.annotation中的方法 修饰符和类型 方法 说明 void
RequestParamMethodArgumentResolver. contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables, ConversionService conversionService)
org.springframework.web.method.support中UriComponentsBuilder的使用
参数类型为UriComponentsBuilder的org.springframework.web.method.support中的方法 修饰符和类型 方法 说明 void
CompositeUriComponentsContributor. contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables)
An overloaded method that uses the ConversionService created at construction.void
CompositeUriComponentsContributor. contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables, ConversionService conversionService)
void
UriComponentsContributor. contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables, ConversionService conversionService)
Process the given method argument and either update theUriComponentsBuilder
or add to the map with URI variables to use to expand the URI after all arguments are processed.org.springframework.web.servlet.mvc.method.annotation中UriComponentsBuilder的使用
返回UriComponentsBuilder的org.springframework.web.servlet.mvc.method.annotation中的方法 修饰符和类型 方法 说明 static UriComponentsBuilder
MvcUriComponentsBuilder. fromController(Class<?> controllerType)
Create aUriComponentsBuilder
from the mapping of a controller class and current request information including Servlet mapping.static UriComponentsBuilder
MvcUriComponentsBuilder. fromController(UriComponentsBuilder builder, Class<?> controllerType)
An alternative toMvcUriComponentsBuilder.fromController(Class)
that accepts aUriComponentsBuilder
representing the base URL.static UriComponentsBuilder
MvcUriComponentsBuilder. fromMethod(Class<?> controllerType, Method method, Object... args)
Create aUriComponentsBuilder
from the mapping of a controller method and an array of method argument values.static UriComponentsBuilder
MvcUriComponentsBuilder. fromMethod(UriComponentsBuilder baseUrl, Class<?> controllerType, Method method, Object... args)
An alternative toMvcUriComponentsBuilder.fromMethod(Class, Method, Object...)
that accepts aUriComponentsBuilder
representing the base URL.static UriComponentsBuilder
MvcUriComponentsBuilder. fromMethodCall(Object info)
Create aUriComponentsBuilder
by invoking a "mock" controller method.static UriComponentsBuilder
MvcUriComponentsBuilder. fromMethodCall(UriComponentsBuilder builder, Object info)
An alternative toMvcUriComponentsBuilder.fromMethodCall(Object)
that accepts aUriComponentsBuilder
representing the base URL.static UriComponentsBuilder
MvcUriComponentsBuilder. fromMethodName(Class<?> controllerType, String methodName, Object... args)
Create aUriComponentsBuilder
from the mapping of a controller method and an array of method argument values.static UriComponentsBuilder
MvcUriComponentsBuilder. fromMethodName(UriComponentsBuilder builder, Class<?> controllerType, String methodName, Object... args)
An alternative toMvcUriComponentsBuilder.fromMethodName(Class, String, Object...)
that accepts aUriComponentsBuilder
representing the base URL.UriComponentsBuilder
MvcUriComponentsBuilder. withController(Class<?> controllerType)
An alternative toMvcUriComponentsBuilder.fromController(Class)
for use with an instance of this class created via a call toMvcUriComponentsBuilder.relativeTo(org.springframework.web.util.UriComponentsBuilder)
.UriComponentsBuilder
MvcUriComponentsBuilder. withMethod(Class<?> controllerType, Method method, Object... args)
An alternative toMvcUriComponentsBuilder.fromMethod(Class, Method, Object...)
for use with an instance of this class created viaMvcUriComponentsBuilder.relativeTo(org.springframework.web.util.UriComponentsBuilder)
.UriComponentsBuilder
MvcUriComponentsBuilder. withMethodCall(Object invocationInfo)
An alternative toMvcUriComponentsBuilder.fromMethodCall(Object)
for use with an instance of this class created viaMvcUriComponentsBuilder.relativeTo(org.springframework.web.util.UriComponentsBuilder)
.UriComponentsBuilder
MvcUriComponentsBuilder. withMethodName(Class<?> controllerType, String methodName, Object... args)
An alternative toMvcUriComponentsBuilder.fromMethodName(Class, String, Object...)
} for use with an instance of this class created viaMvcUriComponentsBuilder.relativeTo(org.springframework.web.util.UriComponentsBuilder)
.参数类型为UriComponentsBuilder的org.springframework.web.servlet.mvc.method.annotation中的方法 修饰符和类型 方法 说明 void
PathVariableMethodArgumentResolver. contributeMethodArgument(MethodParameter parameter, Object value, UriComponentsBuilder builder, Map<String,Object> uriVariables, ConversionService conversionService)
static UriComponentsBuilder
MvcUriComponentsBuilder. fromController(UriComponentsBuilder builder, Class<?> controllerType)
An alternative toMvcUriComponentsBuilder.fromController(Class)
that accepts aUriComponentsBuilder
representing the base URL.static MvcUriComponentsBuilder.MethodArgumentBuilder
MvcUriComponentsBuilder. fromMappingName(UriComponentsBuilder builder, String name)
An alternative toMvcUriComponentsBuilder.fromMappingName(String)
that accepts aUriComponentsBuilder
representing the base URL.static UriComponentsBuilder
MvcUriComponentsBuilder. fromMethod(UriComponentsBuilder baseUrl, Class<?> controllerType, Method method, Object... args)
An alternative toMvcUriComponentsBuilder.fromMethod(Class, Method, Object...)
that accepts aUriComponentsBuilder
representing the base URL.static UriComponentsBuilder
MvcUriComponentsBuilder. fromMethodCall(UriComponentsBuilder builder, Object info)
An alternative toMvcUriComponentsBuilder.fromMethodCall(Object)
that accepts aUriComponentsBuilder
representing the base URL.static UriComponentsBuilder
MvcUriComponentsBuilder. fromMethodName(UriComponentsBuilder builder, Class<?> controllerType, String methodName, Object... args)
An alternative toMvcUriComponentsBuilder.fromMethodName(Class, String, Object...)
that accepts aUriComponentsBuilder
representing the base URL.static MvcUriComponentsBuilder
MvcUriComponentsBuilder. relativeTo(UriComponentsBuilder baseUrl)
Create an instance of this class with a base URL.参数类型为UriComponentsBuilder的org.springframework.web.servlet.mvc.method.annotation中的构造器 构造器 说明 MethodArgumentBuilder(UriComponentsBuilder baseUrl, Class<?> controllerType, Method method)
Create a newMvcUriComponentsBuilder.MethodArgumentBuilder
instance.MvcUriComponentsBuilder(UriComponentsBuilder baseUrl)
Default constructor.org.springframework.web.servlet.support中UriComponentsBuilder的使用
org.springframework.web.servlet.support中UriComponentsBuilder的子类 修饰符和类型 类 说明 class
ServletUriComponentsBuilder
UriComponentsBuilder with additional static factory methods to create links based on the current HttpServletRequest.org.springframework.web.util中UriComponentsBuilder的使用
返回UriComponentsBuilder的org.springframework.web.util中的方法 修饰符和类型 方法 说明 UriComponentsBuilder
UriComponentsBuilder. cloneBuilder()
Clone thisUriComponentsBuilder
.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 ofencode()
with a charset other than "UTF-8".UriComponentsBuilder
UriComponentsBuilder. fragment(String fragment)
static UriComponentsBuilder
UriComponentsBuilder. fromHttpRequest(HttpRequest request)
Create a newUriComponents
object from the URI associated with the given HttpRequest while also overlaying with values from the headers "Forwarded" (RFC 7239), or "X-Forwarded-Host", "X-Forwarded-Port", and "X-Forwarded-Proto" if "Forwarded" is not found.static UriComponentsBuilder
UriComponentsBuilder. fromHttpUrl(String httpUrl)
Create a URI components builder from the given HTTP URL String.static UriComponentsBuilder
UriComponentsBuilder. fromOriginHeader(String origin)
Create an instance by parsing the "Origin" header of an HTTP request.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 givenURI
.static UriComponentsBuilder
UriComponentsBuilder. fromUriString(String uri)
Create a builder that is initialized with the given URI string.UriComponentsBuilder
UriComponentsBuilder. host(String host)
protected UriComponentsBuilder
DefaultUriTemplateHandler. initUriComponentsBuilder(String uriTemplate)
已过时。Create aUriComponentsBuilder
from the URI template string.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. queryParams(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(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 givenUriComponents
instance.UriComponentsBuilder
UriComponentsBuilder. uriVariables(Map<String,Object> uriVariables)
Configure URI variables to be expanded at build time.UriComponentsBuilder
UriComponentsBuilder. userInfo(String userInfo)
参数类型为UriComponentsBuilder的org.springframework.web.util中的方法 修饰符和类型 方法 说明 protected abstract void
UriComponents. copyToUriComponentsBuilder(UriComponentsBuilder builder)
Set all components of the given UriComponentsBuilder.protected UriComponents
DefaultUriTemplateHandler. expandAndEncode(UriComponentsBuilder builder, Object[] uriVariables)
已过时。protected UriComponents
DefaultUriTemplateHandler. expandAndEncode(UriComponentsBuilder builder, Map<String,?> uriVariables)
已过时。参数类型为UriComponentsBuilder的org.springframework.web.util中的构造器 构造器 说明 DefaultUriBuilderFactory(UriComponentsBuilder baseUri)
Variant ofDefaultUriBuilderFactory(String)
with aUriComponentsBuilder
.UriComponentsBuilder(UriComponentsBuilder other)
Create a deep copy of the given UriComponentsBuilder.