美文网首页
Spring boot路径匹配配置

Spring boot路径匹配配置

作者: 青丝如梦 | 来源:发表于2018-11-09 10:47 被阅读0次
    package com.test;
    
    import org.springframework.context.annotation.Configuration;
    import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
    import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
    
    
    @Configuration
    public class UrlMatchConfig extends WebMvcConfigurationSupport {
    
        @Override
        public void configurePathMatch(PathMatchConfigurer configurer) {
            //setUseSuffixPatternMatch 自动过滤后缀'.do'
            //setUseTrailingSlashMatch 自动去掉'/'
            configurer
                    .setUseSuffixPatternMatch(true)
                    .setUseTrailingSlashMatch(true);
        }
    }
    
    

    相关文章

      网友评论

          本文标题:Spring boot路径匹配配置

          本文链接:https://www.haomeiwen.com/subject/rnxgxqtx.html