Package org.springframework.http.server
Interface RequestPath
- All Superinterfaces:
PathContainer
Specialization of
PathContainer
that sub-divides the path into a
contextPath()
and the remaining pathWithinApplication()
.
The latter is typically used for request mapping within the application
while the former is useful when preparing external links that point back to
the application.- Since:
- 5.0
- Author:
- Rossen Stoyanchev
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.http.server.PathContainer
PathContainer.Element, PathContainer.Options, PathContainer.PathSegment, PathContainer.Separator
-
Method Summary
Modifier and TypeMethodDescriptionReturns the portion of the URL path that represents the application.modifyContextPath
(String contextPath) Return a newRequestPath
instance with a modified context path.static RequestPath
Variant ofparse(URI, String)
with the encodedraw path
.static RequestPath
Parse the URI for a request into aRequestPath
.The portion of the request path after the context path which is typically used for request mapping within the application .Methods inherited from interface org.springframework.http.server.PathContainer
elements, subPath, subPath, value
-
Method Details
-
contextPath
PathContainer contextPath()Returns the portion of the URL path that represents the application. The context path is always at the beginning of the path and starts but does not end with "/". It is shared for URLs of the same application.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
. -
pathWithinApplication
PathContainer pathWithinApplication()The portion of the request path after the context path which is typically used for request mapping within the application . -
modifyContextPath
Return a newRequestPath
instance with a modified context path. The new context path must match 0 or more path segments at the start.- Parameters:
contextPath
- the new context path- Returns:
- a new
RequestPath
instance
-
parse
Parse the URI for a request into aRequestPath
.- Parameters:
uri
- the URI of the requestcontextPath
- the contextPath portion of the URI path
-
parse
Variant ofparse(URI, String)
with the encodedraw path
.- Parameters:
rawPath
- the pathcontextPath
- the contextPath portion of the URI path- Since:
- 5.3
-