javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-793

A comment different than <!-- -->, not sent to the HTML output, shall be allowed in JSF xhtml files.

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: Facelets/VDL
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      793
    • Status Whiteboard:
      Hide

      size_medium importance_large

      Show
      size_medium importance_large
    • Tags:

      Description

      Currently, any <!-- --> comment is sent to the HTML output, if this parameter is
      not set in faces-config.xml:

      <context-param>
      <param-name>facelets.SKIP_COMMENTS</param-name>
      <param-value>true</param-value>
      </context-param>

      This is often done to avoid publishing comments that most of the time have for
      audience the developers. However, if the choice is done to skip the comments,
      all will be skipped, and you won't be able to send any public information you
      would really like to see in comments, and more than that, special statements for
      browser management (of the kind <!-- [IE7 ...] -->) won't reach the output.

      Another way, if the facelets.SKIP_COMMENTS isn't used, is to surround each
      internal comment with
      <ui:remove><!-- My comment --></ui:remove>,
      provided an initial declaration
      xmlns:ui="http://java.sun.com/jsf/facelets"
      is written at the beginning of the JSF xhtml file.

      Whatever, choosing to edit the xml(s) files to add facelets.SKIP_COMMENTS or
      surrounding internal comments with <ui:remove> +
      xmlns:ui="http://java.sun.com/jsf/facelets", is clumsy.

      Some kind of comment should be created
      <%-- --%> or any other style, that would set an internal comment never published
      in the HTML output.

        Issue Links

          Activity

          Hide
          rogerk added a comment -

          For most cases, a JSF 2.0 xhtml page will already require the
          xmlns:ui="http://java.sun.com/jsf/facelets" declaration.
          Again, to do what you ask for a smaller subset of JSF XHTML pages will require
          some custom parsing at least to remove the special characters for the comment
          before JSF (Facelets) parsing occurs - otherwise you will end up with SAX parse
          exception. If you are worried about the length of <ui:comment> then perhaps a
          shorter tag name.

          Show
          rogerk added a comment - For most cases, a JSF 2.0 xhtml page will already require the xmlns:ui="http://java.sun.com/jsf/facelets" declaration. Again, to do what you ask for a smaller subset of JSF XHTML pages will require some custom parsing at least to remove the special characters for the comment before JSF (Facelets) parsing occurs - otherwise you will end up with SAX parse exception. If you are worried about the length of <ui:comment> then perhaps a shorter tag name.
          Hide
          rogerk added a comment -

          Lower priority.

          Show
          rogerk added a comment - Lower priority.
          Hide
          rogerk added a comment -

          This may need more discussion if the reporter is not satisfied.
          Will need to reevaluate for 2.2.

          Show
          rogerk added a comment - This may need more discussion if the reporter is not satisfied. Will need to reevaluate for 2.2.
          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
          Manfred Riem added a comment -

          Set priority to Minor

          Show
          Manfred Riem added a comment - Set priority to Minor

            People

            • Assignee:
              Unassigned
              Reporter:
              grunt2000
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: