springboot项目如何获取根路径
springboot项目如何获取根路径
springboot项目如何获取根路径
springboot项目如何获取根路径
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
2条回答 默认 最新
- CSDN专家-sinJack 2022-06-28 16:57关注
试试这个:
String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报