tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reich, Matthias" <>
Subject RE: Comet: problem with request.getParameter() in Comet POST requests
Date Thu, 03 May 2007 08:50:43 GMT

> -----Original Message-----
> From: Rémy Maucherat [] 
> Sent: Wednesday, May 02, 2007 11:13 PM
> On 5/2/07, Sebastiaan van Erk <> wrote:
> > It's a race condition and the problem occurs quite infrequently
> > (especially with small request bodies). The larger the 
> request body of
> > the POST request, the more likely it is that the problem 
> occurs. I was
> > testing at a few thousand request per second, and even then 
> it rarely
> > showed up. The fact that other people out there are using 
> getParameter()
> > on Comet POST requests and expect it to work seems to me to 
> warrant 1)
> > acknowledgement that it is a bug, 2) a warning in the 
> documentation, or
> > 3) a request facade for the Comet API which throws an 
> exception when the
> > getParameter() method is called on a POST request.
> Whatever ;)
> Rémy

I am working on a scenario with browsers as clients.
The client does requests with JavaScript code like this:

  req = new XMLHttpRequest();
  req.onreadystatechange = handler;"post", "/somecontext/somecometservlet/somerequest?param1=val1&param2=val2"

We intentionally use POST requests to avoid problems that occurred with some caches at customer
sites and with web crawlers that monitor the GET requests of a browser and send the identical
requests themselves to analyze the responses.
Thus, only with POST we can achieve an "exactly once" submission of the request.

However, by passing the request parameters in the URL (i.e. in the header and not in the body)
I don't have any problems with reading the request parameters.

You can imagine, that I would not be happy if the API would only offer me a request facade
that throws an exception when the servlet tries to access the parameters of a POST request.


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message