spring boot 请求后缀匹配

spring boot 项目中添加这个类就可以实现url不同后缀区分了

public class UrlMatchConfig extends WebMvcConfigurationSupport {

    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
        //setUseSuffixPatternMatch 后缀模式匹配
        configurer.setUseSuffixPatternMatch(true);
        //setUseTrailingSlashMatch 自动后缀路径模式匹配
        configurer.setUseTrailingSlashMatch(true);
    }
}

你可能感兴趣的:(java,springboot,url,spring,boot,java,后缀)