【发布时间】:2018-08-17 23:21:26
【问题描述】:
我想更改 Spring Boot 2 的上下文路径,例如我想在 http://localhost:8080/test/ 上服务
我的意思是它不适用于 spring-boot-starter-webflux:2.0.0.RELEASE
它只适用于 spring-boot-starter-web::2.0.0.RELEASE
我试过了
server.servlet.context-path=/test
但我什么也没发生,仍然在 url http://localhost:8080/ 上提供服务
【问题讨论】:
-
server.servlet.context-path仅适用于嵌入式容器。你是如何部署你的应用程序的? -
它在 spring-boot-starter-web 上和我一起工作
-
但不适用于 spring-boot-starter-webflux
-
这是合乎逻辑的,因为 webflux 使用 netty 而不是 servlet 容器,所以我怀疑命名空间
server.servlet.*中的属性是否适用于webflux。
标签: spring spring-boot spring-webflux