title: How to make a request which will timeout on tomcat server?
body: <p>I try to make tomcat produce 408. I need it to see how the proxy which i am going to use will behave in such situation.</p>
  
  <p>What i tried to do is an endless loop in REST endpoint:</p>
  
  <pre><code>@RequestMapping(value = "hello")
  public ResponseEntity&lt;String&gt; hello() {
      boolean truth = true;
      while (truth) {
      }
      return new ResponseEntity&lt;String&gt;(HttpStatus.OK);
  }
  </code></pre>
  
  <p>When i access <code>http://localhost:8083/myApp/hello</code>, my browser waits for response and connection does not get reset with timeout.</p>
  
  <p>I tried to configure tomcat's connectionTimeout which in my understanding should consider request timed out after given amount of milliseconds, but change this value does not give an effect and looks like that request can hang forever.</p>
  
  <pre><code>&lt;Connector port="8080" protocol="HTTP/1.1"
             connectionTimeout="1"
             redirectPort="8443" /&gt;
  </code></pre>
  
  <p>What can be wrong? I use Tomcat 7.</p>