搜索
您的当前位置:首页正文

通过启动脚本来修改springboot context-path

来源:易榕旅网

通过启动脚本来修改spring context-path

首先对于spring boot 1.0和2.0 是有区别的

1、 通过修改applicat.yaml 文件

spring 2.x

erver:
 servlet:
   context-path: /xxx
 port: 8080

spring 1.x

server:
 contextPath: /xxx
 port: 8080

2、通过使用Java命令

sping 2.x

--server.servlet.context-path=/xxx
//或者通过  -Dserver.contextPath
-Dserver.servlet.context-path=/xxx

spring 1.x

--server.contextPath==/xxx
//或者通过  -Dserver.contextPath
 -Dserver.contextPath=/xxx

因篇幅问题不能全部显示,请点此查看更多更全内容

Top