类 RequestPath

java.lang.Object
cn.taketoday.http.server.PathContainer
cn.taketoday.http.server.RequestPath
直接已知子类:
DefaultRequestPath, ServletRequestContext.ServletRequestPath

public abstract class RequestPath extends 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.
从以下版本开始:
4.0
作者:
Rossen Stoyanchev
  • 构造器详细资料

    • RequestPath

      public RequestPath()
  • 方法详细资料

    • contextPath

      public abstract 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

      public abstract PathContainer pathWithinApplication()
      The portion of the request path after the context path which is typically used for request mapping within the application .
    • modifyContextPath

      public abstract RequestPath modifyContextPath(String contextPath)
      Return a new 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 path
      返回:
      a new RequestPath instance
    • parse

      public static RequestPath parse(URI uri, @Nullable String contextPath)
      Parse the URI for a request into a RequestPath.
      参数:
      uri - the URI of the request
      contextPath - the contextPath portion of the URI path
    • parse

      public static RequestPath parse(String rawPath, @Nullable String contextPath)
      Variant of parse(URI, String) with the encoded raw path.
      参数:
      rawPath - the path
      contextPath - the contextPath portion of the URI path