How to specify Http Request timeout parameter on Java servlet container

前端 未结 3 1875
花落未央
花落未央 2020-12-07 00:47

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 pr

3条回答
  •  旧时难觅i
    2020-12-07 01:12

    You cannot control the client timeout from the server. However you may be able to send data back to the client every now and then while your long running operation is busy. This will prevent the client from timing out and can be used to display progress to the user etc. Write data to the OutputStream or Writer obtained from the response and call flush to send partial data to the client.

提交回复
热议问题