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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM