让您的配置扩展
WebMvcConfigurationSupport覆盖
requestMappingHandlerMapping()并相应地进行配置。
@Configurationpublic MyConfig extends WebMvcConfigurationSupport { @Bean public PathMatcher pathMatcher() { // Your AntPathMatcher here. } @Bean public RequestMappingHandlerMapping requestMappingHandlerMapping() { RequestMappingHandlerMapping rmhm = super.requestMappingHandlerMapping(); rmhm.setPathMatcher(pathMatcher()); return rmhm; }}


