当前位置: 代码迷 >> Web前端 >> web-inf 目录上的jsp如何引用外部文件:js,css等
  详细解决方案

web-inf 目录上的jsp如何引用外部文件:js,css等

热度:148   发布时间:2012-11-25 11:44:31.0
web-inf 目录下的jsp怎么引用外部文件:js,css等
web-inf是受保护的,不能直接访问
下面是解决方法

<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>
<script type="text/javascript" src="${path}/js/jquery-1.8.1.min.js"></script>
<script type="text/javascript" src="${path}/js/jquery.datepick.js"></script>
<script type="text/javascript" src="${path}/js/jquery.datepick-zh-CN.js"></script>
<link type="text/css" href="${path}/css/smoothness.datepick.css" rel="stylesheet">

ok了。。
  相关解决方案