I am thinking of how to make AJAX take use of servlet 3 async response. in the request-response synchronize processing model, when the response comes back, the callback of XmlHttpRequest can get the response text; but how about the response is processed in another thread, and returns some message, what will the XHR get when the request ends? can it still get the response body? I tried a simple codes to test it, it seems failed to get the response;
I can understand this, when the AJAX request return, there is nothing in the response, it will be delayed in another server thread, so the callback get nothing.
But I wonder is there any way to let AJAX get the correct response?