开发者

JSF Handle served-side exception in browser with A4J

开发者 https://www.devze.com 2023-01-19 14:09 出处:网络
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 occ

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);

}
0

精彩评论

暂无评论...
验证码 换一张
取 消