Spring boot路径匹配配置

2018-11-09  本文已影响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);
    }
}

上一篇下一篇

猜你喜欢

热点阅读