Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Ajax/JavaScript
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      556
    • Status Whiteboard:
      Hide

      cat2 frame size_medium importance_large draft

      Show
      cat2 frame size_medium importance_large draft

      Description

      w/r/t https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=552

      Hello

      I want to comment on the update section of the jsr 314.

      It says with the latest proposal for changes:

      javax.faces.ViewRoot:

      <update id="javax.faces.ViewRoot">
      <![CDATA[...]]>

      </update>

      Update the entire DOM as follows:

      • Extract the CDATA content and trim the <html> and </html> from the CDATA
        content if it is present.

      <<<<<<< (remove the following lines)

      • If the CDATA content contains a <head> element, and the document has a
        <head> section, extract the contents of the <head> element from the <update>
        element's CDATA content and replace the document's <head> section with this

      contents.

      • If the CDATA content contains a <body> element, and the document has a
        <body> section, extract the contents of the <body> element from the <update>
        element's CDATA content and replace the document's <body> section with this

      contents.

      ======= (add the following lines)

      • If the CDATA content contains a <head> element, and the document has a
        <head> section, replace the document's <head> section with the <head> section

      contained within the CDATA content.

      • If the CDATA content contains a <body> element, and the document has a
        <body> section, replace the document's <body> section with the <body> section

      contained within the CDATA content.

      This still is problematic. The issue is following:
      You still have to parse the head and body sections out of the CDATA block, you
      cannot assume valid xml within comes in!
      Now lets have a look at the details:
      The RI tries to solve this and fails in cases where body or head sections occur
      in embedded scripts or in xml/html comments!
      You have to implement a full parser to resolve this, which we have started!
      But I personally think it would be preferrable to resolve this entirely on
      server level, since we have the entire information
      on the server available anyway (at least in almost all cases) and not try to
      offload this onto the client and have javascripts resolve the parsing!

      I would propose following change:

      <update id="javax.faces.ViewRoot">
      <![CDATA[...]]>
      or
      <head>
      <![CDATA[...]]>
      </head>
      <body>

      <![CDATA[...]]>
      </body>
      </update>

      With the simple CDATA block containing the entire stripped html markup
      (preferrable withouth the html tags, but if they have to be included
      no comments before or after are allowed, the html content
      must be prestripped)

      and head and body containing the markup for the head section and the body section
      (including the tags)

      both either head and body can occur without the other!

      No parsing should occur on client level, or minimal parsing, if CDATA is served
      the entire html content is replaced
      for body and head only the body and head sections are replaced as they occur!

      As I said before, we have started to work on the parser as needed by the current
      spec, but I am not sure if it would not
      be better to leave the splitting of the html and head sections to the server
      part and do not offload it to the client.
      For performance reasons it definitely would not impact the server significantly
      while it would introduce another
      load on the client which can be avoided!

      an implementation this way would look like following

      <update id="javax.faces.ViewRoot">
      <![CDATA[
      <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
      </head>

      <body>
      body section
      </body>
      </html>
      ]]>

      </update>

      in this case the entire html block is replaced via the data delivered by CDATA

      <update id="javax.faces.ViewRoot">

      <head>
      <![CDATA[
      <head> <title></title> </head>
      ]]>
      </head>
      <body>

      <![CDATA[
      <body>
      body section
      </body>
      ]]>
      </body>
      </update>

      or

      <update id="javax.faces.ViewRoot">
      <body>

      <![CDATA[
      <body>
      body section

      </body>
      ]]>
      </body>
      </update>

      In none of these cases any significant parsing on the client side must occur!

      Kind Regards

      Werner Punz

        Issue Links

          Activity

          Hide
          rogerk added a comment -

          2.1_gf31_m5

          Show
          rogerk added a comment - 2.1_gf31_m5
          Hide
          rogerk added a comment -

          For now re-target for 2.2.
          If time permits may revisit for 2.1.

          Show
          rogerk added a comment - For now re-target for 2.2. If time permits may revisit for 2.1.
          Hide
          rogerk added a comment -

          triage

          Show
          rogerk added a comment - triage
          Hide
          Ed Burns added a comment -

          Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

          Show
          Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
          Hide
          Ed Burns added a comment -

          Leave unchanged.

          Show
          Ed Burns added a comment - Leave unchanged.

            People

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

              Dates

              • Created:
                Updated: