SpringBoot URL忽略大小写

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

posted @ 2020-04-24 17:06  一白二白  阅读(3578)  评论(0编辑  收藏  举报