更改Spring Boot 2.0上下文路径 [英] change spring boot 2.0 context-path
本文介绍了更改Spring Boot 2.0上下文路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,我想更改Spring Boot 2的上下文路径,我想在 http://localhost:8080上使用/test/
I want to change context path for spring boot 2 for example i want to serve on http://localhost:8080/test/
我的意思是它不适用于spring-boot-starter-webflux:2.0.0.RELEASE
i mean it not working for me with spring-boot-starter-webflux:2.0.0.RELEASE
仅适用于spring-boot-starter-web :: 2.0.0.RELEASE
it only working with spring-boot-starter-web::2.0.0.RELEASE
我尝试过
server.servlet.context-path=/test
但是对我来说,什么都没有发生在url http://localhost:8080/
But nothing happened to me still serve on url http://localhost:8080/
推荐答案
如果您使用servlet API,则该属性现在称为
If you use the servlet API then the property is now called
server.servlet.context-path=/myapp
这篇关于更改Spring Boot 2.0上下文路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文