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

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

作者: 北街九条狗 | 来源:发表于2019-05-23 09:14 被阅读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>

相关文章

网友评论

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

      本文链接:https://www.haomeiwen.com/subject/djimzqtx.html