接口 DispatcherServletPath

所有已知实现类:
DispatcherServletRegistrationBean
函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface DispatcherServletPath
Interface that can be used by auto-configurations that need path details for the default DispatcherServlet.
从以下版本开始:
2.0.4
作者:
Madhura Bhave, Stephane Nicoll
  • 方法概要

    修饰符和类型
    方法
    说明
    Returns the configured path of the dispatcher servlet.
    default String
    Return a cleaned up version of the path that can be used as a prefix for URLs.
    default String
    Return a form of the given path that's relative to the dispatcher servlet path.
    default String
    Return a URL mapping pattern that can be used with a ServletRegistrationBean to map the dispatcher servlet.
  • 方法详细资料

    • getPath

      String getPath()
      Returns the configured path of the dispatcher servlet.
      返回:
      the configured path
    • getRelativePath

      default String getRelativePath(String path)
      Return a form of the given path that's relative to the dispatcher servlet path.
      参数:
      path - the path to make relative
      返回:
      the relative path
    • getPrefix

      default String getPrefix()
      Return a cleaned up version of the path that can be used as a prefix for URLs. The resulting path will have path will not have a trailing slash.
      返回:
      the prefix
      另请参阅:
    • getServletUrlMapping

      default String getServletUrlMapping()
      Return a URL mapping pattern that can be used with a ServletRegistrationBean to map the dispatcher servlet.
      返回:
      the path as a servlet URL mapping