I've attached a test case that illustrates an unpleasant behavior
between XmlHttpRequest and Restlet success responses with no entities.
(We use Jetty connector here as usual.) The server behavior differs
between Restlet 1.0 and 1.1 in how the no-entity responses are sent.
In Firefox 3 and Internet Explorer (possibly others) XmlHttpRequest
gets indigestion and emits a cryptic "no element found" error when
doing a GET or POST to this kind of resource. This error is difficult
to catch, as it seems to happen outside caller code, after the initial
asynchronous call returns and before the callback fires. Depending on
the browser environment, the result is somewhere between noisy and
catastrophic -- an embedded IE inside a SWT browser component on
Windows will lock up permanently trying to report the error.
There's a simple server-side workaround: DON'T send no-entity success responses.
But, seems like Restlet could do something about this ... either (a)
maybe we're not quite right with how we're handling no-entity success,
or (b) we could warn on the server side that sending a 200 with no
entity may have deleterious consequences.
Ideas or recommendations, anybody?
---------- Forwarded message ----------
From: Adam Schwartz <[hidden email]>
Date: Fri, Nov 7, 2008 at 1:42 PM
Subject: no element found test case
To: Rob Heittman <[hidden email]>
Just need the SimpleRestlet attached at "/postTest" and the
sampleLoginPage.html will hit it on a submit. The first, then every
other time the Restlet gets a request, it will send back a Success and
voila, the error.