我正在使用 AngularJS 在 Java 中开发 Web 应用程序。我的问题是 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>
正确的路径应该是什么?
最佳答案
我已经找到解决办法了。我使用的是 lineman,lineman 在“生成”文件夹中创建了真正的 index.html。
关于java - 无法设置 app.js 的正确路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44399669/