方法一:
<script type=
"text/javascript"
src=
"../js/data.js"
></script>
方法
2
:
<%
String path = request.getContextPath();
String basePath = request.getScheme()+
"://"
+request.getServerName()+
":"
+request.getServerPort()+path+
"/"
;
%>
<script type=
"text/javascript"
src=
"<%=path%>/js/data.js"
></script>
转载于:https://blog.51cto.com/4925054/1708314