SpringBoot 2.0+版本 context-path 弃用

最近学习SpringBoot(本人使用的是2.04版本) 发现在yml配置的时候context-path报错了使用不了,查看源码发现context-path已经弃用,代替为

server:
  servlet:
    context-path: /projectName

官方说明:spring-configuration-metadata.json

"deprecated": true,
      "name": "server.context-path",
      "description": "Context path of the application.",
      "type": "java.lang.String",
      "deprecation": {
        "level": "error",
        "replacement": "server.servlet.context-path"
      }

可以看到 "replacement": "server.servlet.context-path"  

仅供参考,欢迎指出错误。

你可能感兴趣的:(经验集锦)