ICEfaces-EE
  1. ICEfaces-EE
  2. IPCK-355

INVALID_CHARACTER_ERR when configuring com.icesoft.facelets.HtmlTagDecorator

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: EE-2.0.0
    • Fix Version/s: EE-3.0.0.GA
    • Component/s: Core Extensions
    • Labels:
      None
    • Environment:
      -
    • Workaround Description:
      Do not use com.icesoft.facelets.HtmlTagDecorator

      Description

      When creating a stock ICE 2.0 EE GA - JSF 2 sample and adding the following param:

      <context-param>
        <param-name>javax.faces.FACELETS_DECORATORS</param-name>
        <param-value>com.icesoft.facelets.HtmlTagDecorator</param-value>
      </context-param>

      I get see the following exception on startup:

      org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal XML character is specified.
      at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createAttribute(CoreDocumentImpl.java:564)
      at org.icefaces.impl.context.DOMResponseWriter.writeAttribute(DOMResponseWriter.java:256)
      at com.icesoft.faces.impl.renderkit.xhtml.XhtmlRendererBase.encodeBegin(XhtmlRendererBase.java:42)
      at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:824)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1641)
      at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1646)
      at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:389)

      The exception is thrown from the following line of ICEfaces 2.0 EE GA code:

      DOMResponseWriter.writeAttribute

      public void writeAttribute(String name, Object value, String property) throws IOException {
            if (null == value) {
                return;
            }
            Attr attribute = document.createAttribute(name.trim());
            attribute.setValue(String.valueOf(value));
            appendToCursor(attribute);
        }

      The 3 method arguments output the following:

      Name:
      Property:null
      Value:http://www.w3.org/1999/xhtml

      Test case attached.

        Activity

        Hide
        Tyler Johnson added a comment -

        There is probably a bug in the following Enterprise feature that was added:

        http://jira.icefaces.org/browse/IPCK-245

        The idea is that com.icesoft.facelets.HtmlTagDecorator causes HTML markup to expand into components so that nesting within dataTable facets is as expected.

        Ted.

        Show
        Tyler Johnson added a comment - There is probably a bug in the following Enterprise feature that was added: http://jira.icefaces.org/browse/IPCK-245 The idea is that com.icesoft.facelets.HtmlTagDecorator causes HTML markup to expand into components so that nesting within dataTable facets is as expected. Ted.
        Hide
        Tyler Johnson added a comment -

        The stack trace indicates that it's processing a component instead of a UIInstruction, and that it's trying to set the attribute of xmlns="http://www.w3.org/1999/xhtml" into a component property, but the property name has gone from "xmlns" to null. One solution would be to omit the <html> tag from the conversion of tags to JSF components, leaving it to be a simple UIInstructions. Otherwise, some special handling of the xmlns and the xmlns:* attributes might be necessary, as the xmlns:* attributes should be consumed by Facelets for its parsing purposes, while xmlns is more of a pass-through.

        • Mark
        Show
        Tyler Johnson added a comment - The stack trace indicates that it's processing a component instead of a UIInstruction, and that it's trying to set the attribute of xmlns="http://www.w3.org/1999/xhtml" into a component property, but the property name has gone from "xmlns" to null. One solution would be to omit the <html> tag from the conversion of tags to JSF components, leaving it to be a simple UIInstructions. Otherwise, some special handling of the xmlns and the xmlns:* attributes might be necessary, as the xmlns:* attributes should be consumed by Facelets for its parsing purposes, while xmlns is more of a pass-through. Mark
        Hide
        Ted Goddard added a comment -

        Attributes with empty names are now not written (this was the case with the xmlns attributes) and the <html> tag is excluded from being converted into a component.

        Show
        Ted Goddard added a comment - Attributes with empty names are now not written (this was the case with the xmlns attributes) and the <html> tag is excluded from being converted into a component.

          People

          • Assignee:
            Ted Goddard
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: