ICEfaces
  1. ICEfaces
  2. ICE-8397

Debug feature for detecting malformed component output markup

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.0.RC1
    • Fix Version/s: 3.2
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      ICEfaces

      Description

      If a component renders incorrect markup (say, omits a closing tag) this can be very difficult to debug because the page corruption is not immediately obvious. A debug feature in DOMResponseWriter would be useful for detecting and analyzing this.

        Activity

        Hide
        Ted Goddard added a comment -

        One technique would be to make use of the fact that the component instance is passed in as an argument to most ResponseWriter calls:

        writer.startElement(HTML.SPAN_ELEM, uiComponent);

        It should be possible to use the component hierarchy together with the DOM hierarchy to detect problems.

        Show
        Ted Goddard added a comment - One technique would be to make use of the fact that the component instance is passed in as an argument to most ResponseWriter calls: writer.startElement(HTML.SPAN_ELEM, uiComponent); It should be possible to use the component hierarchy together with the DOM hierarchy to detect problems.
        Hide
        Ken Fyten added a comment - - edited

        This should only log if JSF PROJECT_STAGE = "Development".

        Show
        Ken Fyten added a comment - - edited This should only log if JSF PROJECT_STAGE = "Development".
        Hide
        Jack Van Ooststroom added a comment - - edited

        Sending core/src/main/java/org/icefaces/impl/context/DOMResponseWriter.java
        Transmitting file data .
        Committed revision 31441.

        Show
        Jack Van Ooststroom added a comment - - edited Sending core/src/main/java/org/icefaces/impl/context/DOMResponseWriter.java Transmitting file data . Committed revision 31441.
        Hide
        Jack Van Ooststroom added a comment - - edited

        Check has been added upon endElement(...) method invocation. The check compares the end element with the current cursor value. If these mismatch a WARNING is logged, but only in Development project stage. The WARNING message is as follows:
        Missing end-element for: [element-name] (path: [path-to-element])
        Please note that one missing end-element in a UIComponent can result in multiple WARNING messages as subsequent invocations of end-element can possibly mismatch as well. The developer should rather focus on the 1st logged WARNING message.
        Marking this one as FIXED.

        Show
        Jack Van Ooststroom added a comment - - edited Check has been added upon endElement(...) method invocation. The check compares the end element with the current cursor value. If these mismatch a WARNING is logged, but only in Development project stage. The WARNING message is as follows: Missing end-element for: [element-name] (path: [path-to-element] ) Please note that one missing end-element in a UIComponent can result in multiple WARNING messages as subsequent invocations of end-element can possibly mismatch as well. The developer should rather focus on the 1st logged WARNING message. Marking this one as FIXED.

          People

          • Assignee:
            Jack Van Ooststroom
            Reporter:
            Ted Goddard
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: