[ACCEPTED]-How to specify Http Request timeout parameter on Java servlet container-containers

Accepted answer
Score: 14

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

You can't control this 1 timeout from the server.

Score: 7

Even though you can't control client timeout, you 9 can make server very impatient :) For example, on 8 Tomcat, you can do this in your connector,

<Connector port="8080"  
  ...
  connectionTimeout ="5000"
  disableUploadTimeout="false" />

This 7 makes server only wait 5 seconds and close 6 the connection. Browser will get a connection 5 closed error. You can treat it the same 4 as timeout in client.

Of course, this 3 only works if the timeout is caused by the 2 server, not connectivity issues between 1 browser and server.

Score: 3

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

More Related questions