public interface RequestPath extends PathContainer
PathContainer
that subdivides the path into a
contextPath()
and the remaining pathWithinApplication()
.
The lattery is typically used for request mapping within the application
while the former is useful when preparing external links that point back to
the application.PathContainer.Element, PathContainer.Options, PathContainer.PathSegment, PathContainer.Separator
Modifier and Type | Method and Description |
---|---|
PathContainer |
contextPath()
Returns the portion of the URL path that represents the application.
|
RequestPath |
modifyContextPath(String contextPath)
Return a new
RequestPath instance with a modified context path. |
static RequestPath |
parse(String rawPath,
String contextPath)
Variant of
parse(URI, String) with the encoded
raw path . |
static RequestPath |
parse(URI uri,
String contextPath)
Parse the URI for a request into a
RequestPath . |
PathContainer |
pathWithinApplication()
The portion of the request path after the context path which is typically
used for request mapping within the application .
|
PathContainer contextPath()
The context path may come from the underlying runtime API such as
when deploying as a WAR to a Servlet container or it may be assigned in
a WebFlux application through the use of
ContextPathCompositeHandler
.
PathContainer pathWithinApplication()
RequestPath modifyContextPath(String contextPath)
RequestPath
instance with a modified context path.
The new context path must match 0 or more path segments at the start.contextPath
- the new context pathRequestPath
instancestatic RequestPath parse(URI uri, @Nullable String contextPath)
RequestPath
.uri
- the URI of the requestcontextPath
- the contextPath portion of the URI pathstatic RequestPath parse(String rawPath, @Nullable String contextPath)
parse(URI, String)
with the encoded
raw path
.rawPath
- the pathcontextPath
- the contextPath portion of the URI path