public class PathMatchConfigurer extends Object
Configured path matcher and path helper instances are shared for:
RequestMappingHandlerMapping,
SimpleUrlHandlerMapping| Constructor and Description |
|---|
PathMatchConfigurer() |
| Modifier and Type | Method and Description |
|---|---|
PathMatchConfigurer |
addPathPrefix(String prefix,
Predicate<Class<?>> predicate)
Configure a path prefix to apply to matching controller methods.
|
org.springframework.util.PathMatcher |
getPathMatcher() |
protected Map<String,Predicate<Class<?>>> |
getPathPrefixes() |
org.springframework.web.util.UrlPathHelper |
getUrlPathHelper() |
Boolean |
isUseRegisteredSuffixPatternMatch()
Deprecated.
as of 5.2.4. See class-level note in
RequestMappingHandlerMapping on the deprecation of path extension
config options. |
Boolean |
isUseSuffixPatternMatch()
Deprecated.
as of 5.2.4. See class-level note in
RequestMappingHandlerMapping on the deprecation of path extension
config options. |
Boolean |
isUseTrailingSlashMatch() |
PathMatchConfigurer |
setPathMatcher(org.springframework.util.PathMatcher pathMatcher)
Set the PathMatcher implementation to use for matching URL paths
against registered URL patterns.
|
PathMatchConfigurer |
setUrlPathHelper(org.springframework.web.util.UrlPathHelper urlPathHelper)
Set the UrlPathHelper to use for resolution of lookup paths.
|
PathMatchConfigurer |
setUseRegisteredSuffixPatternMatch(Boolean registeredSuffixPatternMatch)
Deprecated.
as of 5.2.4. See class-level note in
RequestMappingHandlerMapping on the deprecation of path extension
config options. |
PathMatchConfigurer |
setUseSuffixPatternMatch(Boolean suffixPatternMatch)
Deprecated.
as of 5.2.4. See class-level note in
RequestMappingHandlerMapping on the deprecation of path extension
config options. |
PathMatchConfigurer |
setUseTrailingSlashMatch(Boolean trailingSlashMatch)
Whether to match to URLs irrespective of the presence of a trailing slash.
|
@Deprecated public PathMatchConfigurer setUseSuffixPatternMatch(Boolean suffixPatternMatch)
RequestMappingHandlerMapping on the deprecation of path extension
config options.By default this is set to true.
registeredSuffixPatternMatch@Deprecated public PathMatchConfigurer setUseRegisteredSuffixPatternMatch(Boolean registeredSuffixPatternMatch)
RequestMappingHandlerMapping on the deprecation of path extension
config options.configure content
negotiation. This is generally recommended to reduce ambiguity and to
avoid issues such as when a "." appears in the path for other reasons.
By default this is set to "false".
public PathMatchConfigurer setUseTrailingSlashMatch(Boolean trailingSlashMatch)
The default value is true.
public PathMatchConfigurer setUrlPathHelper(org.springframework.web.util.UrlPathHelper urlPathHelper)
Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple HandlerMappings and MethodNameResolvers.
public PathMatchConfigurer setPathMatcher(org.springframework.util.PathMatcher pathMatcher)
AntPathMatcherpublic PathMatchConfigurer addPathPrefix(String prefix, Predicate<Class<?>> predicate)
Prefixes are used to enrich the mappings of every @RequestMapping
method whose controller type is matched by the corresponding
Predicate. The prefix for the first matching predicate is used.
Consider using HandlerTypePredicate to group controllers.
prefix - the prefix to applypredicate - a predicate for matching controller types@Nullable @Deprecated public Boolean isUseSuffixPatternMatch()
RequestMappingHandlerMapping on the deprecation of path extension
config options.@Nullable @Deprecated public Boolean isUseRegisteredSuffixPatternMatch()
RequestMappingHandlerMapping on the deprecation of path extension
config options.@Nullable public Boolean isUseTrailingSlashMatch()
@Nullable public org.springframework.web.util.UrlPathHelper getUrlPathHelper()
@Nullable public org.springframework.util.PathMatcher getPathMatcher()