MyFaces Core
  1. MyFaces Core
  2. MYFACES-1774

HtmlLinkRenderer should output & instead of & as the url param separator within href attribute according to HTML Spec

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.5, 1.2.0
    • Fix Version/s: 1.1.7, 1.2.7
    • Component/s: General, JSR-127, JSR-252
    • Labels:
      None

      Description

      Currently a <h:outputLink> with nested <f:param> components is rendered as
      <a href="somepage?foo=1&bar=2">...</a>

      According to http://www.w3.org/TR/html401/ the character entity "&" should be used instead of "&":
      "Authors should use "&" (ASCII decimal 38) instead of "&" to avoid confusion with the beginning of a character reference (entity reference open delimiter). Authors should also use "&" in attribute values since character references are allowed within CDATA attribute values."

      Though current browsers seem to have no problem with "&" characters within href attributes, this issue gets serious when using XHTML. Not using the character entity "&" instead of "&" leads to invalid (not well-formed) XML data!
      Therefore I think we should fix this.

      BTW, the RI renders the wrong "&" as well.

        Issue Links

          Activity

          Hide
          Manfred Geiler added a comment -
          Show
          Manfred Geiler added a comment - We should introduce a config param as suggested by Mario: http://www.nabble.com/Rendering-%22-amp-%22-instead-of-%22-%22-for-href-attribute-tf4849854.html
          Hide
          Ryan Lubke added a comment -

          Actually, if the response content type is xhtml, the RI will render &, otherwise it will render '&'

          Show
          Ryan Lubke added a comment - Actually, if the response content type is xhtml, the RI will render &, otherwise it will render '&'
          Hide
          Leonardo Uribe added a comment -

          The class HtmlResponseWriterImpl method writeURIAttribute is responsible of render & as &, so if we solve MYFACES-1841, we solve theorically this one (enforcing the usage of & on all URIs rendered). I'll do some tests before commit it.

          Show
          Leonardo Uribe added a comment - The class HtmlResponseWriterImpl method writeURIAttribute is responsible of render & as &, so if we solve MYFACES-1841 , we solve theorically this one (enforcing the usage of & on all URIs rendered). I'll do some tests before commit it.

            People

            • Assignee:
              Manfred Geiler
              Reporter:
              Manfred Geiler
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development