Interface DispatcherServletPath
- All Known Implementing Classes:
DispatcherServletRegistrationBean
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface DispatcherServletPath
Interface that can be used by auto-configurations that need path details for thedefault
DispatcherServlet
.- Since:
- 2.0.4
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getPath()
Returns the configured path of the dispatcher servlet.default String
getPrefix()
Return a cleaned up version of the path that can be used as a prefix for URLs.default String
getRelativePath(String path)
Return a form of the given path that's relative to the dispatcher servlet path.default String
getServletUrlMapping()
Return a URL mapping pattern that can be used with aServletRegistrationBean
to map the dispatcher servlet.
Method Detail
getPath
String getPath()
Returns the configured path of the dispatcher servlet.- Returns:
- the configured path
getRelativePath
default String getRelativePath(String path)
Return a form of the given path that's relative to the dispatcher servlet path.- Parameters:
path
- the path to make relative- Returns:
- 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.- Returns:
- the prefix
- See Also:
getRelativePath(String)
getServletUrlMapping
default String getServletUrlMapping()
Return a URL mapping pattern that can be used with aServletRegistrationBean
to map the dispatcher servlet.- Returns:
- the path as a servlet URL mapping