Problem with interruption of ajax request in RichFaces
I use seam and RichFaces in the project. If user performs action to leave the page (i.e. clicks s:link) while a4j ajax request is still active then alert with error 599 appears (Request error, status : 599 Network error).
I can found error logs only in <a4j:log>
output:
debug[17:56:32,419]: NEW AJAX REQUEST !!! with form: aforma
debug[17:56:32,420]: Start XmlHttpRequest debug[17:56:32,421]: Request state : 1 debug[17:56:32,428]: QueryString: AJAXREQUEST=_viewRoot&aforma%3Aj_id62%3Aname=&aforma%3Aj_id74%3Aj_id82=&aforma%3AproductFileUploadLink%3Afile=&aforma%3Aj_id125=20&aforma%3AconfirmationPanelOpenedState=&aforma%3Aj_id177=confirm1&aforma=aforma&autoScroll=&javax.faces.ViewState=j_id4&aforma%3Aj_id86%3AcontentType=0&ajaxSingle=aforma%3Aj_id86%3AcontentType&aforma%3Aj_id86%3Aj_id95=aforma%3Aj_id86%3Aj_id95& debug[17:56:40,338]: Request state : 4 debug[17:56:40,338]: Request end with state 4 error[17:56:40,338]: Request error, status : 0 debug[17:56:43,551]: No parsed XML document in response debug[17:56:43,551]: Processing updates finished, no oncomplete function to call 开发者_如何学运维
What is the better way to avoid such errors?
Hmm... In JSF2 you can add your own errorHandler. In Javascript:
var handleError = function(data) {
//handle error here
};
jsf.ajax.addOnError(handleError);
Probably there is something similar in RichFaces.
精彩评论