[richfaces-svn-commits] JBoss Rich Faces SVN: r2390 - in trunk/framework/impl/src/main: resources/org/ajax4jsf and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Aug 21 20:22:56 EDT 2007


Author: alexsmirnov
Date: 2007-08-21 20:22:56 -0400 (Tue, 21 Aug 2007)
New Revision: 2390

Modified:
   trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
   trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
Log:
Check response status, for a network communication problems.

Modified: trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js
===================================================================
--- trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js	2007-08-21 23:38:32 UTC (rev 2389)
+++ trunk/framework/impl/src/main/javascript/ajaxjsf/JSFAJAX.js	2007-08-22 00:22:56 UTC (rev 2390)
@@ -54,7 +54,14 @@
 		      		if(_this._timeoutID){
 		      			window.clearTimeout(_this._timeoutID);
 		      		}
-		      		if(_this._request.status == 200){
+		      		var requestStatus;
+		      		try{
+		      			requestStatus = _this._request.status;
+		      		} catch(e){
+		      			LOG.error("request don't have status code - network problem");
+		      			requestStatus = 501;
+		      		}
+		      		if(requestStatus == 200){
 						try {
             				LOG.debug("Response  with content-type: "+ _this.getResponseHeader('Content-Type'));
 			            	LOG.debug("Full response content: ", _this.getResponseText());
@@ -72,10 +79,10 @@
 		      				_this.onready(_this);
 		      			}
 		      		} else {
-		      			_this._errorMessage = "Reqest error, status : "+_this._request.status +" " + _this._request.statusText + "\n Message: " + _this.getResponseHeader("Ajax-Error-Message");
+		      			_this._errorMessage = "Reqest error, status : "+requestStatus +" " + _this._request.statusText + "\n Message: " + _this.getResponseHeader("Ajax-Error-Message");
 		      			LOG.error(_this._errorMessage);
 		      			if(typeof(_this._onerror) == "function"){
-		      				_this._onerror(_this,_this._request.status,_this._errorMessage);
+		      				_this._onerror(_this,requestStatus,_this._errorMessage);
 		      			}
 		      		}
 		      		if(_this.onfinish){

Modified: trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties
===================================================================
--- trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties	2007-08-21 23:38:32 UTC (rev 2389)
+++ trunk/framework/impl/src/main/resources/org/ajax4jsf/messages.properties	2007-08-22 00:22:56 UTC (rev 2390)
@@ -230,7 +230,7 @@
 AJAX_SUPPORT_REQUEST_PARAMETER_INFO=Have request parameter for AjaxSupport component {0}
 COMMAND_LINK_SUBMIT_INFO=CommandLink component {0} submit request
 COMMAND_LINK_NOT_IN_FORM_WARNING=CommandLink {0} not enclosed in form
-MUST_BE_EXPRESSION_ERROR=Must be expression to modifyable property
+MUST_BE_EXPRESSION_ERROR=Must be expression to modifiable property
 NOT_PARENT_AJAX_CONTAINER_ERROR=Parent is not of type AjaxContainer, type is\: {0}
 NOT_PARENT_AJAX_COMPONENT_ERROR=Parent component {0} for a ajaxListener is not source of AjaxEvent's
 MUST_BE_LITERAL_ERROR=Must be literal
@@ -250,4 +250,5 @@
 AJAX_VIEW_EXPIRED=View state could't be restored - reload page ?
 SKIN_CYCLIC_REFERENCE=Cyclic reference in Skin configuration for property \: {0}
 SKIN_ILLEGAL_REFERENCE=Reference for property "{0}" not present in Skin configuration
-NULL_ATTRIBUTE_ERROR="Requied attribute {0} for component {1} is null
\ No newline at end of file
+NULL_ATTRIBUTE_ERROR=Requied attribute {0} for component {1} is null
+UI_INSERT_RESOURCE_NOT_FOUND="Resource {1} not found, component {0}
\ No newline at end of file




More information about the richfaces-svn-commits mailing list