Jsp中路径问题

${pageContext.request.contextPath}”的作用是取出部署的应用程序名,这样不管如何部署,所用路径都是正确的。
 <!--使用绝对路径的方式引入CSS文件-->
<link rel="stylesheet"href="${pageContext.request.contextPath}/themes/default/css/ueditor.css" type="text/css"/>
<!--使用绝对路径的方式引入JavaScript脚本-->
<script type="text/javascript"src="${pageContext.request.contextPath}/ueditor1_3_6-gbk-jsp/ueditor.config.js"></script>

使用<%=request.getContextPath()%>和使用${pageContext.request.contextPath}达到同样的效果
<script type="text/javascript" src="<%=request.getContextPath()%>/ueditor1_3_6-gbk-jsp/ueditor.all.js"></script>
posted @ 2017-07-13 15:22  个子  阅读(172)  评论(0编辑  收藏  举报