Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-1899

XTile doesn't handle response payloads larger than 4096 bytes in firefox

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 4.1.2
    • None
    • Contrib
    • None
    • Client: Windows XT/Firefox 2.0.0.9
      Server: Windows XT/JBoss 4.0.4
      Tapestry: 4.1.2

    Description

      The extractData method of the XTile component doesn't handle AJAX responses larger than 4096 bytes when using the XMLHttpRequest object - as opposed to the ActiveXObjects.

      The problem is that extractData - as defined in XTile.script - only looks at the firstChild of the <sp> element as shown in the following code snippet:

      function extractData(response)
      {
      var xml = response.responseXML.documentElement;
      var dataList = new Array();
      if (xml) dataList = xml.getElementsByTagName('sp');
      var dataLen = dataList.length;
      var data = new Array();
      for (i = 0; i < dataLen; i++)

      { var child = dataList[i].firstChild; if (child) data[i] = child.data; else data[i] = ""; }

      return data;
      }

      The following version of extractData fixes the problem by iterating over all children of the <sp> node:

      function extractData(response)
      {
      var xml = response.responseXML.documentElement;
      var dataList = new Array();
      if (xml)

      { dataList = xml.getElementsByTagName('sp'); }

      var dataLen = dataList.length;
      var data = new Array();
      for (i = 0; i < dataLen; i++) {
      var children = dataList[i].childNodes;
      data[i] = "";
      for (j = 0; j < children.length; j++) {
      var child = children[j];
      if (child)

      { data[i] += child.data; }

      }
      }
      return data;
      }

      Tested in both IE and Firefox and this change works properly in both cases.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              apache@rpdavison.ca Peter Davison
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: