关于jsp页面中调用.js文件无法识别

2019-05-23  本文已影响0人  北街九条狗

在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>
上一篇下一篇

猜你喜欢

热点阅读