转自:
下文笔者讲述springboot忽略url大小写的方法分享,如下所示
实现思路:
只需重写configurePathMatch方法
即可实现忽略springboot中url大小写的示例
例:URL忽略大小写
/** * MVC配置类 */ @Configuration public class WebMvcConfig implements WebMvcConfigurer { @Resource private WebPathConfig webPathConfig; /** * 接口地址忽略大小写 * @param configurer */ @Override public void configurePathMatch(PathMatchConfigurer configurer) { AntPathMatcher matcher = new AntPathMatcher(); matcher.setCaseSensitive(false); configurer.setPathMatcher(matcher); } }