Path Matching

You can customize options related to path matching and treatment of the URL. For details on the individual options, see the PathMatchConfigurer javadoc.

The following example shows how to customize path matching:

@Configuration
public class WebConfiguration implements WebMvcConfigurer {

  @Override
  public void configurePathMatch(PathMatchConfigurer configurer) {
    configurer.addPathPrefix("/api", HandlerTypePredicate.forAnnotation(RestController.class));
  }

  private PathPatternParser patternParser() {
    PathPatternParser pathPatternParser = new PathPatternParser();
    // ...
    return pathPatternParser;
  }
}