You'll need the servlet to handle the Exception and send some
error code back to the XMLHttpRequest and handle it that way.
It seems obvious that you can't propagate
Java exceptions
through XHR. However you could send the Exception stack trace back,
but it is probably not a good idea to show this to the user.