jsf-extensions
  1. jsf-extensions
  2. JSF_EXTENSIONS-93

Possible regression concerning CDATA in v3 prelude

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Won't Fix
    • Affects Version/s: current
    • Fix Version/s: not determined
    • Component/s: runtime
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      93

      Description

      A JSF application I'm writing with dynamic faces works in v2 but not in v3
      prelude. I've traced the problem to a CDATA issue. The partial-response
      contained in the Ajax response for v2 looks like this:

      <partial-response><components><render
      id="com.sun.faces.avatar.ViewRoot"><markup><![CDATA[
      <html>
      ...
      <script type="text/javascript" language="Javascript">
      //<![CDATA[
      function dpf(f) {var adp = f.adp;if (adp != null) {for (var i = 0;i <
      adp.length;i++)

      {f.removeChild(adp[i]);}}};function apf(f, pvp) {var adp = new
      Array();f.adp = adp;var ps = pvp.split(',');for (var i = 0,ii = 0;i <
      ps.length;i+,ii+) {var p = document.createElement("input");p.type =
      "hidden";p.name = ps[i];p.value = ps[i + 1];f.appendChild(p);adp[ii] = p;i +=
      1;}};function jsfcljs(f, pvp, t) {apf(f, pvp);var ft = f.target;if (t) {f.target = t;}f.submit();f.target = ft;dpf(f);};
      //]]]]><![CDATA[>
      </script>
      ...
      </html>
      ]]></markup></render></components><state>
      ...
      </state></partial-response>

      (Notice the properly escaped line
      //]]]]><![CDATA[>

      And when I keep everything else exactly the same but switch to v3 prelude, it
      looks like this:

      <partial-response><components><render
      id="com.sun.faces.avatar.ViewRoot"><markup><![CDATA[
      <html>
      ...
      <script type="text/javascript" language="Javascript">
      //<![CDATA[
      function dpf(f) {var adp = f.adp;if (adp != null) {for (var i = 0;i <
      adp.length;i++) {f.removeChild(adp[i]);}

      }};function apf(f, pvp) {var adp = new
      Array();f.adp = adp;var i = 0;for (k in pvp) {var p =
      document.createElement("input");p.type = "hidden";p.name = k;p.value =
      pvp[k];f.appendChild(p);adp[i++] = p;}};function jsfcljs(f, pvp, t) {apf(f,
      pvp);var ft = f.target;if (t)

      {f.target = t;}

      f.submit();f.target = ft;dpf(f);};
      //]]>
      </script>
      ...
      </html>
      ]]></markup></render></components><state>

      (Notice the lack of escaping in the line
      //]]>

      The partial responses in their entirety are attached.

        Activity

        Hide
        mattbohm added a comment -

        Created an attachment (id=30)
        v2-partial-response.txt

        Show
        mattbohm added a comment - Created an attachment (id=30) v2-partial-response.txt
        Hide
        mattbohm added a comment -

        Created an attachment (id=31)
        v3prelude-partial-response.txt

        Show
        mattbohm added a comment - Created an attachment (id=31) v3prelude-partial-response.txt
        Hide
        mattbohm added a comment -

        Commentary from rlubke:

        Probably related to this change:
        https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=716

        Ed had made HtmlResponseWriter changes for some issues in dynamic faces,
        however, these changes
        broke a fundamental usage of the response writer for other developers. I
        reverted the change.

        I would recommend logging an issue against dynamic faces so an alternate fix can
        be attempted on their
        end.

        Show
        mattbohm added a comment - Commentary from rlubke: Probably related to this change: https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=716 Ed had made HtmlResponseWriter changes for some issues in dynamic faces, however, these changes broke a fundamental usage of the response writer for other developers. I reverted the change. I would recommend logging an issue against dynamic faces so an alternate fix can be attempted on their end.
        Hide
        mattbohm added a comment -

        Actually, it seems this would affect just about any application using dynamic
        faces with v3 prelude or later, so raising to P1. I'm hoping edburns can do an
        evaluation.

        Show
        mattbohm added a comment - Actually, it seems this would affect just about any application using dynamic faces with v3 prelude or later, so raising to P1. I'm hoping edburns can do an evaluation.
        Hide
        Ed Burns added a comment -

        I am no longer tracking progress of these projects on java.net.

        Show
        Ed Burns added a comment - I am no longer tracking progress of these projects on java.net.

          People

          • Assignee:
            Ed Burns
            Reporter:
            mattbohm
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: