【坑】【SpringBoot】指定服务项目名

使用不同SpringBoot版本,指定访问项目路径的项目名,使用的配置也不一样


有网友指出

SpringBoot版本

配置

1.x

server.context-path=/demo

2.x

server.servlet.context-path=/demo

以下为本地测试可行代码

pom.xml中使用SpringBoot版本

<version>1.5.9.RELEASE</version>

application.properties文件添加

server.context-path=/demo

pom.xml中使用SpringBoot版本

<version>2.0.2.RELEASE</version>

application.properties文件添加

server.servlet.context-path=/demo

猜你喜欢

转载自blog.csdn.net/web15286201346/article/details/124461405