如何在App Engine中回收/WEB-INF URL?

发布于 2024-12-27 09:41:11 字数 538 浏览 0 评论 0原文

我希望所有 URL(映射到静态文件的 URL 除外)都由我的 Servlet 处理。

我已经正确设置了它,它的工作方式就像一个魅力除了,url /WEB-INF/ 始终由 App-engine 中的静态文件处理程序处理。

即使我将其放入 appengine-web.xml 中:

<static-files>
    <include path="/s/**" />
    <exclude path="/WEB-INF" />
</static-files

它仍然静态处理 /WEB-INF 网址。 (/s/** 路径是我的应用程序特定的静态文件路径。)

此外,所有以 /WEB-INF 开头的路径也都是静态处理的,尽管文件实际上并没有按预期得到服务。

有没有办法阻止静态处理程序捕获 /WEB-INF 路径?

I want all URLs, except the ones that map to a static file, to be handled by my Servlet.

I have set it up correctly, and it works like a charm except that the url /WEB-INF/ gets always handled by the static file handler in App-engine.

Even if I put this in my appengine-web.xml:

<static-files>
    <include path="/s/**" />
    <exclude path="/WEB-INF" />
</static-files

it still handles the /WEB-INF url statically. (The /s/** path is my app specific path to static files.)

Moreover, all paths beginning with /WEB-INF are also handled statically, although the files are not actually served as expected.

Is there any way to stop the static handler from capturing the /WEB-INFpath?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱殇璃 2025-01-03 09:41:11

/WEB-INF 不是外部可访问的资源。您无法在浏览器中输入 /WEB-INF/web.xml ,可以吗?

它用作存储配置数据的服务器专用目录。

/WEB-INF is not an externally accessible resource. You can not type /WEB-INF/web.xml in your browser, can you?

It is used as a server-private directory where configuration data is stored.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文