springboot2.0设置servlet-path

在springboot1.x的版本中,想要在请求接口时后面带上.do或者.html之类的后缀,直接配置

server:
  servlet-path: "*.do"

就可以,但是在springboot2.x中,这个配置是默认关闭的,需要

spring:
  mvc:
    pathmatch:
      use-suffix-pattern: true
server:
  servlet:
    path: "*.html"

开启配置后才会生效。

你可能感兴趣的:(springboot2.0设置servlet-path)