如何在 Java servlet 容器上指定 Http 请求超时参数 [英] How to specify Http Request timeout parameter on Java servlet container

查看:24
本文介绍了如何在 Java servlet 容器上指定 Http 请求超时参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想了解在哪里可以为到达我的 servlet(或我的所有 servlet)的所有请求配置请求超时?在我看来,那是容器属性吗?另外,这如何影响不同的浏览器?它们是否都符合容器规定的参数?或者请求超时时间甚至不是我可以控制的,每个浏览器都自行决定?(为了清楚起见,我不是在谈论会话超时)

I'm trying to understand where I can configure a request timeout for all requests arriving to a servlet of mine (or all of my servlets)? Is that, as I think, a container property? Also, how does this affect different browsers? Do they all comply to the parameter the container dictates? Or maybe the request timeout time isn't even something I can control and each browser decides on this on its own? (Just to be clear I'm not talking about session timeout)

推荐答案

客户端的超时时间(即等待对 HTTP 请求的响应的时间)在客户端确定.对于 IE,请参见 this,对于 Firefox,请参见 这个.

The timeout from a client (i.e. how long it waits for a response to an HTTP request) is determined at the client. For IE, see this, and for Firefox see this.

您无法从服务器控制此超时.

You can't control this timeout from the server.

这篇关于如何在 Java servlet 容器上指定 Http 请求超时参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆