Chrome(或 Chrome 框架)发送两个或多个请求而不是一个?
我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我真的不知道为什么 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.