Tapestry
  1. Tapestry
  2. TAPESTRY-1899

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

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.1.2
    • Fix Version/s: None
    • Component/s: Contrib
    • Labels:
      None
    • Environment:
      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.

        Issue Links

          Activity

          Peter Davison created issue -
          Andreas Andreou made changes -
          Field Original Value New Value
          Link This issue is a clone of TAPESTRY-961 [ TAPESTRY-961 ]
          Hide
          Andreas Andreou added a comment -

          Not sure why that one was rejected

          Show
          Andreas Andreou added a comment - Not sure why that one was rejected
          Mark Thomas made changes -
          Workflow jira [ 12416862 ] Default workflow, editable Closed status [ 12568539 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12568539 ] jira [ 12590087 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Peter Davison
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:

                Development