【发布时间】:2019-02-06 15:07:12
【问题描述】:
当我调用我的 spring-boot 应用程序的上下文根“localhost:8080/api/players”时,它通过注解 @GetMapping(path= {"/ 映射到 RestController 方法中",""}), 总是重定向 (httpstatus: 307 临时重定向) 到 "localhost:8080/api/players/" 在末尾添加斜杠。
我的应用程序上下文根确实是 /api/players,如 spring-boot application.properties 文件(server.servlet.context-path=/api/players)
我已经尝试使用嵌入式 tomcat,并且通过设置属性 server.tomcat.redirect-context-root=false
可以正常工作有没有办法配置 undertow 像 tomcat 一样工作?
【问题讨论】:
标签: java spring spring-boot undertow embedded-server