jsp基础路径,在jsp头部加上,获取基础路径http://localhost:8080/fmw/,fmw为当前项目名
String basePath = "";
String path =request.getContextPath();
basePath =request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
如果是用jquery,可以在该jsp文件中加入
<basePath value ="<%=basePath%>" id ="basePath"></basePath>
然后在js文件里获得basePath标签的value basePath=$('#basePath').attr("value");
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。