【发布时间】:2017-06-06 20:55:18
【问题描述】:
我正在使用 angularjs 用 Java 开发 webapp。我的问题是我在 app.js 和 app.css 文件上得到 404。
index.html 的路径
webapp/WEB-INF/app/pages/index.html
app.js 的路径
webapp/WEB-INF/app/js/app.js
app.css 的路径
webapp/WEB-INF/app/css/app.css
在html中连接css和脚本:
<link rel="stylesheet" type="text/css" href="/css/app.css" media="all" />
<script type="text/javascript" src="/js/app.js"></script>
正确的路径应该是什么?
【问题讨论】:
-
这些都是静态资源,你有没有试过用类似的东西:
? -
用户 WebContent 添加 index.html 页面。在 webContent .ex 脚本中添加子文件夹是子文件夹。脚本下的 app.js。添加指向 index.html 页面的链接。
标签: java angularjs spring-mvc