gpt4 book ai didi

tomcat - 尝试访问js文件时获取404

转载 作者:行者123 更新时间:2023-11-28 23:39:11 26 4
gpt4 key购买 nike

我使用 Spring 作为 Rest Server,所有应用程序都由客户端管理。

我已将我的 UI 文件复制到 webapps\文件夹:

webapps\<MY APP>
-> scripts (where I have my js files)
-> directives
-> services
-> styles
-> views
-> META-INF
-> WEB-INF
index.html

问题是当导航到 http://localhost:8080/devstage-1.0/ 时我得到了 index.html 但是当它试图获取目录内的 js 依赖项时我返回 404。

GET http://localhost:8080/devstage-1.0/scripts/services/dictionary.js 404 (Not Found) 

据我所知,Spring 只管理 WEB-INF 中的文件。我是否需要做一些其他配置才能使这些文件可访问?

最佳答案

找到了问题,这是我的错字。

我在 Grunt 中使用了复制目标,而不是/** 它递归地复制文件和文件夹,我把/* 只复制一个级别,这意味着文件夹(没有内容)和文件。

关于tomcat - 尝试访问js文件时获取404,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21662955/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com