我有一个 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 应用程序中设置多个上下文路径吗?