GET parameters, ie parameters in the URL will work.
However, using Comet you shouldn't rely on parameters in the body, the body if for you usage, and your usage alone.
Seems to me that this is a pretty common use case though with AJAX server side push: request, wait, response. Comet is used to free the http thread while waiting, otherwise the server would be out of http threads in no time.
The data posted is often in POST form (a scripted form post).
You can still invoke getReader or getInputStream without actually reading from it, if that causes the parse to happen.
Yes, that is my current workaround, I use READ events and the Content-Length header to parse the parameters myself.
I still need to rethink the "no read event" when the body comes in with the request package. btw, Remy is working on improving the available() method to actually return data should there be some, this will take care of the sentence above and also work around the blocking reads
Filip
Currently I'm using the workaround suggested, I just do a read in the BEGIN event (I need to do that for the parameter parsing as well). I'd be really happy if the available() method returned >0 if there was data, that would already mean that the above workaround is failsafe (i.e., no blocking).

As for the final solution, the current documentation on the website is a bit ambiguous: it says in the READ event description, "It is not allowed to attempt reading data from the request object outside of the execution of this method." However, "this method" is the event method, so it could be interpreted as meaning that it's OK to read in the BEGIN event. Personally I think the API would be cleanest if it was not confused with the current implementation, that is, that the event method is called with a READ directly after BEGIN if available() > 0. READ means "data available" (according to the same docs), and even though no extra I/O event occurred on the socket, for the user of the API that condition is met.

Thanks for all the replies and fixes so far!

Sebastiaan

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to