Author: jonathan
Date: Thu Jul 17 16:14:16 2008
New Revision: 19438
URL: http://wso2.org/svn/browse/wso2?view=rev&revision=19438

Log:
MASHUP-972 fix.  Seems to have to do with custom UIs named index.htm.

It looked like the "this" context of the nested check for "index.htm" is 
incorrectly set (though Firebug acts pretty weird on FF3 so maybe that's a 
debugging artifact.)  In any case I check for index.html and index.htm in 
parallel now instead of in sequence, and I haven't seen a recurrence.  Tyrell, 
please review the code since this appears to have lots of tricky failover 
behavior.

Modified:
   trunk/mashup/java/modules/www/js/utils.js

Modified: trunk/mashup/java/modules/www/js/utils.js
URL: 
http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/www/js/utils.js?rev=19438&r1=19437&r2=19438&view=diff
==============================================================================
--- trunk/mashup/java/modules/www/js/utils.js   (original)
+++ trunk/mashup/java/modules/www/js/utils.js   Thu Jul 17 16:14:16 2008
@@ -37,28 +37,6 @@
                         if (typeof callback != 'undefined') {
                             callback.call(this);
                         }
-                    } else {
-                        //Check for index.htm
-                        xmlHttpRequest4ui.open("GET", serviceLocation + 
"/index.htm", true);
-
-                        xmlHttpRequest4ui.onreadystatechange = function () {
-                            if (xmlHttpRequest4ui.readyState == 4) {
-                                try {
-                                    if (xmlHttpRequest4ui.status == 200) {
-                                        if (typeof callback != 'undefined') {
-                                            callback.call(this);
-                                        }
-                                    }
-                                } catch(ex) {
-                                    if (requestCountCustomUI < 
maxRecursionsCustomUI) {
-                                        requestCountCustomUI++;
-                                        isCustomUiAvailable(serviceLocation, 
callback);
-                                    }
-                                }
-                            }
-                        }
-
-                        xmlHttpRequest4ui.send(null);
                     }
                 } catch(ex) {
                     if (requestCountCustomUI < maxRecursionsCustomUI) {
@@ -71,6 +49,30 @@
 
         xmlHttpRequest4ui.send(null);
     }
+
+    var xmlHttpRequest4ui2 = createXmlHttpRequest();
+
+    xmlHttpRequest4ui2.open("GET", serviceLocation + "/index.htm", true);
+
+    xmlHttpRequest4ui2.onreadystatechange = function () {
+        if (xmlHttpRequest4ui2.readyState == 4) {
+            try {
+                if (xmlHttpRequest4ui2.status == 200) {
+                    if (typeof callback != 'undefined') {
+                        callback.call(this);
+                    }
+                }
+            } catch(ex) {
+                if (requestCountCustomUI < maxRecursionsCustomUI) {
+                    requestCountCustomUI++;
+                    isCustomUiAvailable(serviceLocation, callback);
+                }
+            }
+        }
+    }
+
+    xmlHttpRequest4ui2.send(null);
+
 }
 
 function isGadgetAvailable(serviceLocation, callback) {

_______________________________________________
Mashup-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/mashup-dev

Reply via email to