类 PathMatchConfigurer
- java.lang.Object
- org.springframework.web.reactive.config.PathMatchConfigurer
public class PathMatchConfigurer extends Object
Assist with configuringHandlerMapping
's with path matching options.- 从以下版本开始:
- 5.0
- 作者:
- Rossen Stoyanchev, Brian Clozel
构造器概要
构造器 构造器 说明 PathMatchConfigurer()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 PathMatchConfigurer
addPathPrefix(String prefix, Predicate<Class<?>> predicate)
Configure a path prefix to apply to matching controller methods.protected Map<String,Predicate<Class<?>>>
getPathPrefixes()
protected Boolean
isUseCaseSensitiveMatch()
protected Boolean
isUseTrailingSlashMatch()
PathMatchConfigurer
setUseCaseSensitiveMatch(Boolean caseSensitiveMatch)
Whether to match to URLs irrespective of their case.PathMatchConfigurer
setUseTrailingSlashMatch(Boolean trailingSlashMatch)
Whether to match to URLs irrespective of the presence of a trailing slash.
构造器详细资料
PathMatchConfigurer
public PathMatchConfigurer()
方法详细资料
setUseCaseSensitiveMatch
public PathMatchConfigurer setUseCaseSensitiveMatch(Boolean caseSensitiveMatch)
Whether to match to URLs irrespective of their case. If enabled a method mapped to "/users" won't match to "/Users/".The default value is
false
.
setUseTrailingSlashMatch
public PathMatchConfigurer setUseTrailingSlashMatch(Boolean trailingSlashMatch)
Whether to match to URLs irrespective of the presence of a trailing slash. If enabled a method mapped to "/users" also matches to "/users/".The default value is
true
.
addPathPrefix
public PathMatchConfigurer addPathPrefix(String prefix, Predicate<Class<?>> predicate)
Configure a path prefix to apply to matching controller methods.Prefixes are used to enrich the mappings of every
@RequestMapping
method whose controller type is matched by the correspondingPredicate
. The prefix for the first matching predicate is used.Consider using
HandlerTypePredicate
to group controllers.- 参数:
prefix
- the path prefix to applypredicate
- a predicate for matching controller types- 从以下版本开始:
- 5.1
isUseTrailingSlashMatch
@Nullable protected Boolean isUseTrailingSlashMatch()
isUseCaseSensitiveMatch
@Nullable protected Boolean isUseCaseSensitiveMatch()