Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3630

PartialViewContextImpl.findHeadComponent and findBodyComponent does not take into account h:head or h:body inside child of UIViewRoot

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.0.16, 2.1.10
    • None
    • None

    Description

      There is a small bug on PartialViewContextImpl.findHeadComponent. It says this:

      private UIComponent findHeadComponent(UIViewRoot root)
      {
      for (UIComponent child : root.getChildren())
      {
      if (child instanceof HtmlHead)

      { return child; }
      else
      {
      for (UIComponent grandchild : child.getChildren())
      {
      if (child instanceof HtmlHead)
      { return child; }
      }
      }
      }
      return null;
      }

      but it should be this:

      private UIComponent findHeadComponent(UIViewRoot root)
      {
      for (UIComponent child : root.getChildren())
      {
      if (child instanceof HtmlHead)
      { return child; }

      else
      {
      for (UIComponent grandchild : child.getChildren())
      {
      if (grandchild instanceof HtmlHead)

      { return grandchild; }

      }
      }
      }
      return null;
      }

      Usually h:head and h:body are direct children of UIViewRoot, so it is difficult to see any problem. This is only relevant when org.apache.myfaces.STRICT_JSF_2_REFRESH_TARGET_AJAX web config param is set to true.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: