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);
}
}
