Chrome(或 Chrome 框架)发送两个或多个请求而不是一个?

发布于 2024-09-24 18:15:26 字数 179 浏览 1 评论 0原文

我使用 HTML5 视频标签,后端是 Java 。它在 Firefox 中工作正常,但在 Chrome 中它会向 servlet 发送多个请求,最后 servlet 中出现异常并且不起作用。

我首先阅读了在 DOM 中创建元素,然后将 src 分配给它,但它仍然发送多个请求。

你有什么解决办法吗?

I use HTML5 video tag, back-end is on Java. It works fine in Firefox but in Chrome it sends more than one requests to servlet and finally there is Exception in servlet and it doesn't work.

I've read that firstly to make element in DOM and then assign src to it, but still it sends more than one requests.

Do you have any solutions for me?

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

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

发布评论

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

评论(1

女皇必胜 2024-10-01 18:15:26

我真的不知道为什么 Chrome 会向您的 servlet 发送多个请求。但老实说,我认为您应该修复 servlet 中的异常原因,因为基本上您无法控制任何人(Chrome 或可能的攻击者)发送到您的服务的请求。当与“外部”通信时,任何组件都应该预料到意外情况。

如果您提供堆栈跟踪和/或一些附加信息(可能在新问题中),您可能会获得有关此问题的一些帮助。

I don't really know why Chrome sends more than one request to your servlet. But honestly, I think you should just fix the exception cause in your servlet because basically you have no control over the requests that anyone (Chrome or a possible attacker) sends to your service. When communicating with the "outside" any component should expect the unexpected.

If you provide the stack trace and/or some additional information, possibly in a new question, you might get some help with this issue.

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