public class PathMatchConfigurer extends Object
RequestMappingHandlerMapping
path matching options such as trailing slash match, suffix registration or path matcher/helper.RequestMappingHandlerMapping
Constructor and Description |
---|
PathMatchConfigurer() |
Modifier and Type | Method and Description |
---|---|
org.springframework.util.PathMatcher |
getPathMatcher() |
org.springframework.web.util.UrlPathHelper |
getUrlPathHelper() |
Boolean |
isUseRegisteredSuffixPatternMatch() |
Boolean |
isUseSuffixPatternMatch() |
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 useRegisteredSuffixPatternMatch)
Whether to use suffix pattern match for registered file extensions only
when matching patterns to requests.
|
PathMatchConfigurer |
setUseSuffixPatternMatch(Boolean useSuffixPatternMatch)
Whether to use suffix pattern match (".*") when matching patterns to
requests.
|
PathMatchConfigurer |
setUseTrailingSlashMatch(Boolean useTrailingSlashMatch)
Whether to match to URLs irrespective of the presence of a trailing slash.
|
public PathMatchConfigurer setUseSuffixPatternMatch(Boolean useSuffixPatternMatch)
The default value is true
.
public PathMatchConfigurer setUseTrailingSlashMatch(Boolean useTrailingSlashMatch)
The default value is true
.
public PathMatchConfigurer setUseRegisteredSuffixPatternMatch(Boolean useRegisteredSuffixPatternMatch)
If enabled, a controller method mapped to "/users" also matches to
"/users.json" assuming ".json" is a file extension registered with the
provided ContentNegotiationManager
.
The ContentNegotiationManager
can be customized
using a ContentNegotiationConfigurer
.
If enabled, this flag also enables
useSuffixPatternMatch
. The
default value is false
.
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)
AntPathMatcher
public Boolean isUseSuffixPatternMatch()
public Boolean isUseTrailingSlashMatch()
public Boolean isUseRegisteredSuffixPatternMatch()
public org.springframework.web.util.UrlPathHelper getUrlPathHelper()
public org.springframework.util.PathMatcher getPathMatcher()