org.springframework.web.servlet.config.annotation

## Class PathMatchConfigurer

- java.lang.Object
- - org.springframework.web.servlet.config.annotation.PathMatchConfigurer

-     public class PathMatchConfigurer
      extends Object

  Helps with configuring `RequestMappingHandlerMapping` path matching options such as trailing slash match, suffix registration or path matcher/helper.
  Since:
    4.0.3
  Author:
    Brian Clozel
  See Also:
    `RequestMappingHandlerMapping`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PathMatchConfigurer()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PathMatcher` | `getPathMatcher()`
    `UrlPathHelper` | `getUrlPathHelper()`
    `Boolean` | `isUseRegisteredSuffixPatternMatch()`
    `Boolean` | `isUseSuffixPatternMatch()`
    `Boolean` | `isUseTrailingSlashMatch()`
    `PathMatchConfigurer` | `setPathMatcher(PathMatcher pathMatcher)` Set the PathMatcher implementation to use for matching URL paths against registered URL patterns.
    `PathMatchConfigurer` | `setUrlPathHelper(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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PathMatchConfigurer

          public PathMatchConfigurer()

  - ### Method Detail

    - #### setUseSuffixPatternMatch

          public PathMatchConfigurer setUseSuffixPatternMatch(Boolean useSuffixPatternMatch)

      Whether to use suffix pattern match (".*") when matching patterns to requests. If enabled a method mapped to "/users" also matches to "/users.*".

      The default value is `true`.

    - #### setUseTrailingSlashMatch

          public PathMatchConfigurer setUseTrailingSlashMatch(Boolean useTrailingSlashMatch)

      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`.

    - #### setUseRegisteredSuffixPatternMatch

          public PathMatchConfigurer setUseRegisteredSuffixPatternMatch(Boolean useRegisteredSuffixPatternMatch)

      Whether to use suffix pattern match for registered file extensions only when matching patterns to requests.

      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`.

      See Also:
        `RequestMappingHandlerMapping`, `ContentNegotiationConfigurer`

    - #### setUrlPathHelper

          public PathMatchConfigurer setUrlPathHelper(UrlPathHelper urlPathHelper)

      Set the UrlPathHelper to use for resolution of lookup paths.

      Use this to override the default UrlPathHelper with a custom subclass, or to share common UrlPathHelper settings across multiple HandlerMappings and MethodNameResolvers.

    - #### setPathMatcher

          public PathMatchConfigurer setPathMatcher(PathMatcher pathMatcher)

      Set the PathMatcher implementation to use for matching URL paths against registered URL patterns. Default is AntPathMatcher.
      See Also:
        `AntPathMatcher`

    - #### isUseSuffixPatternMatch

          public Boolean isUseSuffixPatternMatch()

    - #### isUseTrailingSlashMatch

          public Boolean isUseTrailingSlashMatch()

    - #### isUseRegisteredSuffixPatternMatch

          public Boolean isUseRegisteredSuffixPatternMatch()

    - #### getUrlPathHelper

          public UrlPathHelper getUrlPathHelper()

    - #### getPathMatcher

          public PathMatcher getPathMatcher()