tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronald Klop <ronald-mailingl...@base.nl>
Subject POST request with timeout acts weird
Date Fri, 02 Oct 2009 13:20:04 GMT
Hello,

I have made the servlet which I include below. If I send this request to it:

> telnet localhost 8080
POST /timeout HTTP/1.1
Host: crm.ronald.base.nl     
Content-Type: application/x-www-form-urlencoded
Content-Length: 100 

But I don't send any data. My servlet than waits in getParameterMap(), because that try's
to read the inputstream and parse the parameters. After 20 seconds (Connector has connectionTimeout="20000")
the reading of the inputstream ends, but my application just gets an empty Map in stead of
some TimeoutException. In this case the browser receives a HTTP 200 OK in stead of HTTP ???
TIMEOUT.

Why? And how should I handle this?

(The real problem is that IE has some issue's and that some of my customers sometimes send
synchronous ajax calls which don't send any data. I'm investigating that too. If somebody
has a tip about that it is also appreciated.)

Ronald.

packages test;
import ...;
public final class TimeoutTestServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        Map params = req.getParameterMap();
        System.out.println("params: " + params);
    }
}

    <servlet>
        <servlet-name>timeout</servlet-name>
        <servlet-class>test.TimeoutTestServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>timeout</servlet-name>
        <url-pattern>/timeout</url-pattern>
    </servlet-mapping>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message