open class ServletUriComponentsBuilder : UriComponentsBuilder
UriComponentsBuilder with additional static factory methods to create links based on the current HttpServletRequest.
Note: This class extracts and uses values from the headers "Forwarded" (RFC 7239), or "X-Forwarded-Host", "X-Forwarded-Port", and "X-Forwarded-Proto" if "Forwarded" is not found, in order to reflect the client-originated protocol and address. As an alternative consider using the org.springframework.web.filter.ForwardedHeaderFilter to have such headers extracted once and removed, or removed only (without being used). See the reference for further information including security considerations.
Author
Rossen Stoyanchev
Since
3.1
open fun cloneBuilder(): ServletUriComponentsBuilder |
|
open static fun fromContextPath(request: HttpServletRequest): ServletUriComponentsBuilder
Prepare a builder from the host, port, scheme, and context path of the given HttpServletRequest. Note: This method extracts values from "Forwarded" and "X-Forwarded-*" headers if found. See class-level docs. |
|
open static fun fromCurrentContextPath(): ServletUriComponentsBuilder
Same as Note: This method extracts values from "Forwarded" and "X-Forwarded-*" headers if found. See class-level docs. |
|
open static fun fromCurrentRequest(): ServletUriComponentsBuilder
Same as Note: This method extracts values from "Forwarded" and "X-Forwarded-*" headers if found. See class-level docs. |
|
open static fun fromCurrentRequestUri(): ServletUriComponentsBuilder
Same as Note: This method extracts values from "Forwarded" and "X-Forwarded-*" headers if found. See class-level docs. |
|
open static fun fromCurrentServletMapping(): ServletUriComponentsBuilder
Same as Note: This method extracts values from "Forwarded" and "X-Forwarded-*" headers if found. See class-level docs. |
|
open static fun fromRequest(request: HttpServletRequest): ServletUriComponentsBuilder
Prepare a builder by copying the scheme, host, port, path, and query string of an HttpServletRequest. Note: This method extracts values from "Forwarded" and "X-Forwarded-*" headers if found. See class-level docs. |
|
open static fun fromRequestUri(request: HttpServletRequest): ServletUriComponentsBuilder
Prepare a builder from the host, port, scheme, and path (but not the query) of the HttpServletRequest. Note: This method extracts values from "Forwarded" and "X-Forwarded-*" headers if found. See class-level docs. |
|
open static fun fromServletMapping(request: HttpServletRequest): ServletUriComponentsBuilder
Prepare a builder from the host, port, scheme, context path, and servlet mapping of the given HttpServletRequest. If the servlet is mapped by name, e.g. Note: This method extracts values from "Forwarded" and "X-Forwarded-*" headers if found. See class-level docs. |
|
open fun removePathExtension(): String
Remove any path extension from the
|