Package org.springframework.http.server
Interface RequestPath
- All Superinterfaces:
PathContainer
public interface RequestPath extends PathContainer
Represents the complete path for a request.- 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
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description PathContainer
contextPath()
Returns the portion of the URL path that represents the application.RequestPath
modifyContextPath(String contextPath)
Return a newRequestPath
instance with a modified context path.static RequestPath
parse(URI uri, String contextPath)
Create a newRequestPath
with the given parameters.PathContainer
pathWithinApplication()
The portion of the request path after the context path.Methods inherited from interface org.springframework.http.server.PathContainer
elements, subPath, subPath, value
Method Detail
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.
modifyContextPath
RequestPath modifyContextPath(String contextPath)
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
static RequestPath parse(URI uri, @Nullable String contextPath)
Create a newRequestPath
with the given parameters.