美文网首页
springboot2.0设置servlet-path

springboot2.0设置servlet-path

作者: 春苟哈皮 | 来源:发表于2018-09-20 10:56 被阅读0次

在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

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