相关疑难解决方法(0)

在 Spring Boot 中,如何重定向上下文路径之外?

我有一个 Spring Boot 应用程序,在我定义的属性文件中:

server.servlet.context-path= /myapp
Run Code Online (Sandbox Code Playgroud)

如果我去的话,http://localhost/myapp我会看到一切都如预期的那样。但是,如果我转到:http://localhost我会看到来自 Apache Tomcat 的标准 404 错误页面。

如何在 Spring Boot 中设置从/到 的重定向?/myapp

或者/等效:我可以在单个 spring-boot 应用程序中设置多个上下文路径吗?

java tomcat spring-boot

1
推荐指数
1
解决办法
5789
查看次数

标签 统计

java ×1

spring-boot ×1

tomcat ×1