Calling SynchronousXHR

I’m trying to call SynchronousXHR and post data to a jsp whenever there is a communication error.

However it doesn’t seem to be working.

        SynchronousXHR syncXHR = (SynchronousXHR) SynchronousXHR.create();
        syncXHR.synchronousPost("/jsp/collectError.jsp", "url=123"+"&error=message");

Any ideas?