springboot2.0设置servlet-path

2018-09-20  本文已影响0人  春苟哈皮

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

server:
  servlet-path: "*.do"

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

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

开启配置后才会生效。

上一篇下一篇

猜你喜欢

热点阅读