5 Replies Latest reply on Jun 30, 2008 1:11 PM by Mike Hanafey

    NEKO HTML correction in Ajax4Jsf/richfaces filter and perfor

    mgrouch Expert

      rich:togglePanel produces javascript which makes HTML malformed
      and it is not corrected by NEKO.

      You can reproduce it by putting togglePanel into Ajax zone and trying to
      refresh this zode with ajax4jsf request when parser is set to NEKO (intead of default TIDY which is a source of major performance problems anyway).

      I think the goal should be to have richfaces components written in such
      a way that no parsing would be required at the end of ajax requests.
      (Not even with NEKO).

      I think the best way to achieve it is to throw exception by NEKO parser
      instead of trying correct and hide errors in output produced by JSF components and test all the components under that set up before releases.

      What do you think?
      Thanks

        • 1. Re: NEKO HTML correction in Ajax4Jsf/richfaces filter and pe
          mgrouch Expert

          Hmm

          it is actually "less than" sign in javascript that breaks in Ajax4Jsf NEKO filter

          <script type="text/javascript" language="Javascript">function dpf(f) {var adp = f.adp;if (adp != null) {for (var i = 0;i < adp.length;i++) {f.removeChild(adp);}}};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;p.value = ps[i + 1];f.appendChild(p);adp[ii] = p;i += 1;}};function jsfcljs(f, pvp, t) {apf(f, pvp);if (t) {f.target = t;}f.submit();dpf(f);};</script>


          Not sure yet which component is inserting this script though...


          • 2. Re: NEKO HTML correction in Ajax4Jsf/richfaces filter and pe
            mgrouch Expert

            Hmm

            it is actually "less than" sign in javascript that breaks in Ajax4Jsf NEKO filter

            <script type="text/javascript" language="Javascript">function dpf(f) {var adp = f.adp;if (adp != null) {for (var i = 0;i < adp.length;i++) {f.removeChild(adp);}}};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;p.value = ps[i + 1];f.appendChild(p);adp[ii] = p;i += 1;}};function jsfcljs(f, pvp, t) {apf(f, pvp);if (t) {f.target = t;}f.submit();dpf(f);};</script>


            Not sure yet which component is inserting this script though...


            • 3. Re: NEKO HTML correction in Ajax4Jsf/richfaces filter and pe
              mgrouch Expert

              It looks like malformed xml is actually coming from
              h:commandLink when it inserts javascript with "less than" sign.

              I've also tried s:link and it also causes problems by
              inserting ampersand.



              • 4. Re: NEKO HTML correction in Ajax4Jsf/richfaces filter and pe
                Alexey Shakov Newbie

                I have the same problem.

                I want to use the RichFaces without XML-parser due to performance reasons.
                Even with NEKO-Parser some requests are too slow (i.e. huge DataTables). It takes about 50% of server CPU-Time to parse such a XML-response.

                But it seems, like many RF-components produce incorrect XML, becouse they don't distinguish between AJAX and non-AJAX requests...

                • 5. Re: NEKO HTML correction in Ajax4Jsf/richfaces filter and pe
                  Mike Hanafey Newbie

                  I have reported this same problem that showed up with the new Firefox 3 browser. In my case the problem was caused by JSF-RI not enclosing its script (which looks like the script referenced here) in a CDATA section, and this behaviour was triggered by the different "Accept" header produced by Firefox 3.

                  Take a look at http://jboss.com/index.html?module=bb&op=viewtopic&t=137678, and the JIRA case referenced therein for more details.