SpringBoot URL忽略大小写
在有些系统对接的时候,url接口不需要区分大小写,做个笔记,以后能找到
原文:https://www.cnblogs.com/minhou/p/8608302.html
package com.biubiu.filter.config;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
/**
* WebConfig url忽略大小写
*
* @author biubiu
*/
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
AntPathMatcher matcher = new AntPathMatcher();
matcher.setCaseSensitive(false);
configurer.setPathMatcher(matcher);
}
}