jsp文件中获取项目真实路径
- 作者: 裤子挂钩
- 来源: 51数据库
- 2021-08-13
jsp文件中获取项目真实路径
<%@ page contentType="text/html;charset=utf-8" language="java" %> <%@ taglib uri="http://www.51sjk.com/Upload/Articles/1/0/255/255351_20210628003332161.jpg prefix="c"%> <% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; System.out.println(basePath); %>
输出basePath:
推荐阅读