1

I heard that Tomcat support servlet 3.0 and thread per request. And I don't experiment like this: Servlet seems to handle multiple concurrent browser requests synchronously

I expected that Thread.sleep wouldn't block other requests even made from the same browser window, but it does. The output is still not in concurrent way.

So how to configure Tomcat 7 support thread per request?

4

1 回答 1

1

您在这里与 HTTP keep-alive 作斗争。您的浏览器和 Tomcat 将采取行动以节省 TCP 连接并通过单个连接发送多个请求。但是你为什么要在请求线程中睡觉呢?服务器应该为请求提供服务,而不是进入睡眠状态。

于 2013-08-24T07:29:35.770 回答