Top Description Fields Constructors Methods
org.springframework.web.reactive.config

public Class PathMatchConfigurer

extends Object
Class Inheritance
Imports
java.util.LinkedHashMap, .Map, java.util.function.Predicate, org.springframework.lang.Nullable, org.springframework.web.util.pattern.PathPatternParser

Assist with configuring HandlerMapping's with path matching options.
Authors
Rossen Stoyanchev, Brian Clozel
Since
5.0

Field Summary

Modifier and TypeField and Description
private Boolean
private Map<String, Predicate<Class<?>>>
private Boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public PathMatchConfigurer
addPathPrefix(String
the path prefix to apply
prefix
,
Predicate<Class<?>>
a predicate for matching controller types
predicate
)

Configure a path prefix to apply to matching controller methods.

protected Map<String, Predicate<Class<?>>>
protected Boolean
protected Boolean
public PathMatchConfigurer
setUseCaseSensitiveMatch(Boolean caseSensitiveMatch)

Whether to match to URLs irrespective of their case.

public PathMatchConfigurer
setUseTrailingSlashMatch(Boolean trailingSlashMatch)

Whether to match to URLs irrespective of the presence of a trailing slash.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

caseSensitiveMatchback to summary
private Boolean caseSensitiveMatch
Annotations
@Nullable
pathPrefixesback to summary
private Map<String, Predicate<Class<?>>> pathPrefixes
Annotations
@Nullable
trailingSlashMatchback to summary
private Boolean trailingSlashMatch
Annotations
@Nullable

Constructor Detail

PathMatchConfigurerback to summary
public PathMatchConfigurer()

Method Detail

addPathPrefixback to summary
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 corresponding Predicate. The prefix for the first matching predicate is used.

Consider using HandlerTypePredicate to group controllers.

Parameters
prefix:String

the path prefix to apply

predicate:Predicate<Class<?>>

a predicate for matching controller types

Since
5.1
getPathPrefixesback to summary
protected Map<String, Predicate<Class<?>>> getPathPrefixes()
Annotations
@Nullable
isUseCaseSensitiveMatchback to summary
protected Boolean isUseCaseSensitiveMatch()
Annotations
@Nullable
isUseTrailingSlashMatchback to summary
protected Boolean isUseTrailingSlashMatch()

Deprecated

Annotations
@Nullable
@Deprecated
setUseCaseSensitiveMatchback to summary
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.

setUseTrailingSlashMatchback to summary
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 was changed in 6.0 from true to false in order to support the deprecation of the property.

Annotations
@Deprecated
since:6.0