<script

  type="text/javascript"
  src="<%=ApplicationContextUtil.getBasePath(request)%>esf-js/jquery.sortable.js">
</script>
文件放置在webContent/webRoot目录下:
 
1.<%=ApplicationContextUtil.getBasePath(request)%>
2.<%=request.getcontextPath()%>
3.${request.contextPath}
4.${page.request.contextPath}
5.${pageContext.request.contextPath}
6.
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>  
 
 
相对路径:
  aaa.js         :同目录下的aaa.js
  ../aaa.js      :上一级目录下的aaa.js
  ../js/aaa.js   :当前目录的上级目录下的js目录下的aaa.js
posted on 2017-04-04 16:09  duenboa  阅读(225)  评论(0编辑  收藏  举报