在jsp中写入下面语句引用文件,
<script src="${pageContext.request.contextPath}/jq/jq.js"></script>
<script src="${pageContext.request.contextPath}/jq/template-web.js"></script>
但运行后无法读取文件,需要在web.xml文件中web-app标签上插入下面语句就可以解决
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID"
version="3.1">
</web-app>
网友评论