JSF Handle served-side exception in browser with A4J
Can A4J handle a situation in whi开发者_Python百科ch ajax call to a server ends with an exception? By handle I mean can it for instance present user with a dialog box stating that an exception has occured? The default behaviour of A4J in presence of a server side exception is to just do nothing which is somewhat misleading.
Yes.
You can do it with A4J:
add this to your javascript on any page:
A4J.AJAX.onError = function(req, status, message){
window.alert("Custom onError handler "+message);
}
精彩评论