4 Replies Latest reply on Mar 20, 2007 4:49 PM by markmaslow

    Strange error after upgrading to Ajax4JSF-1.1.0.jar

    markmaslow

      I have an application working fine using:

      JSF 1.2_04
      Facelets
      Ajax4JSF 1.0.6

      After swapping in Ajax4JSF-1.1.0.jar, one of my pages gives the following error. The really strange thing is that I don't recognize the HTML shown at all. Doesn't look like anything that appears on the page when things work correctly.

      XML Parsing Error: not well-formed Location: http://localhost:8080/helen2/pages/secure/ind/show-ind.jsf Line Number 392, Column 26:
      <option value="GILBERT & ELLICE">GILBERT & ELLICE</option>
      -------------------------^
      


        • 1. Re: Strange error after upgrading to Ajax4JSF-1.1.0.jar

          Still the same problem. & should not appear in the code like that. From the XHTML point of view, & means xml entity.

          • 2. Re: Strange error after upgrading to Ajax4JSF-1.1.0.jar
            markmaslow

            I have run the same application with everything exactly the same, except that one version uses Ajax4JSF 1.0.6 and the other uses Ajax4JSF 1.1.0. I examined the HTML source carefully when run successfully under 1.0.6.

            If I use Ajax4JSF 1.0.6, all ampersands (&) get translated to:

            &amp;
            


            After upgrading to Ajax4JSF 1.1.0, the error shows that, for a selectOneMenu component, the display value is properly translated, but the value is not:

            <option value="GILBERT & ELLICE">GILBERT &amp; ELLICE</option>
            


            It seems that a bug was introduced in version 1.1.0 that makes this version unusable for an application that works without any problem in version 1.0.6.

            Unfortunately, it seems that it is not possible to use RichFaces with version 1.0.6. So I'm kind of stuck until this problem is resolved.

            Do you agree that it's a bug? If so, when do you think it will be resolved?

            • 3. Re: Strange error after upgrading to Ajax4JSF-1.1.0.jar

              No. it is not a bug in Ajax4jsf for sure.

              Ajax4jsf 1.0.x has forceparser set to true by default . So, Tidy filter correct all problems in you code. You even had no idea the problem exists.

              Ajax4jsf 1.1.x has forceparser set to false by default . Now, Tidy filter just does nothing with the xhtml in the non-Ajax responses.

              So, just set it to true explicitly and you will return back to auto-corrections mode.

              • 4. Re: Strange error after upgrading to Ajax4JSF-1.1.0.jar
                markmaslow

                After setting forceparser to true, seems everything works as it did before.

                Thank you very much.

                I know it's a bad idea to have ampersands in code values, but there's not much I can do, since the data comes from a 3rd party system.

                Good to know about this, as I can see that there are other situations where a setting of true will cause other problems.

                Anyway, thanks again for your help resolving this.