我在尝试从 WEB-INF 文件夹加载欢迎文件时收到请求的资源不可用错误,在我的 web.xml 中它看起来像这样:
<welcome-file-list>
<welcome-file>WEB-INF/html/index.html</welcome-file>
</welcome-file-list>
换句话说,html 文件位于名为“html”的文件夹中的 WEB-INF 目录中...
那么我该如何正确地做到这一点呢?所有这些路径都是如此复杂,我的意思是是否有某种路径指南或其他任何东西?因为我无法开发,因为当找不到某些东西时我会陷入这些事情,因为我写的路径的解释与我预期的不同...
最佳答案
WEB-INF目录下的文件不能直接访问。
参见 URL :
Place private files in the WEB-INF directory, under the root directory. All files under WEB-INF are private, and are not served to a client.
关于java - WEB-INF 文件夹中的 web.xml 欢迎文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16180090/