Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.2
    • Component/s: Components/Renderers
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      784
    • Status Whiteboard:
      Hide

      adf adf_medium size_small importance_large

      Show
      adf adf_medium size_small importance_large

      Description

      UIComponent defines the following type-safe methods for retrieving the "current"
      component and composite component:

      public static UIComponent getCurrentComponent(FacesContext context);
      public static UIComponent getCurrentCompositeComponent(FacesContext context)

      In addition, UIComponent also defines two related constants:

      public static final String CURRENT_COMPONENT =
      "javax.faces.component.CURRENT_COMPONENT";
      public static final String CURRENT_COMPOSITE_COMPONENT =
      "javax.faces.component.CURRENT_COMPOSITE_COMPONENT";

      And specifies that these constants may be used to retrieve the current
      component/composite component from the FacesContext attribute map.

      These constants assume that a particular implementation is used for
      pushing/popping the current component to EL - ie. one that happens to store the
      current component/composite component on the FacesContext attribute map.
      However, this is a bad assumption for the specification to make, since a more
      obvious implementation choice would be to managed the current component info in
      a stack.

      The spec should be changed to either:

      • Remove these constants. Or...
      • Remove the requirement that implementations must publish the current
        component/composite component via these constants.

      To allow for more reasonable implementations.

      Other reasons for de-supporting these constants include:

      1. They provide no advantage over the type safe methods that provide access to
      the same information.
      2. They expose an implementation detail which could lead to dangerous code - ie.
      no code other than pushComponentToEl/popComponentToEL should be able mess with
      these values.
      3. The requirement that the FacesContext attributes must be set adds overhead to
      implementations which choose to use a stack for managing the current
      component/composite component.

      Note that Mojarra should be switching over to a stack-based implementation soon
      and as such #3 will soon mean unnecessary overhead for both Mojarra and MyFaces.
      (MyFaces already uses the stack approach and must take extra steps to publish
      the current component/composite component values in order to comply with the spec.)

        Activity

        Hide
        Ed Burns added a comment -

        2.1

        Show
        Ed Burns added a comment - 2.1
        Hide
        Ed Burns added a comment -

        triage

        Show
        Ed Burns added a comment - triage
        Hide
        Ed Burns added a comment -

        rogerk

        Show
        Ed Burns added a comment - rogerk
        Hide
        rogerk added a comment -

        target

        Show
        rogerk added a comment - target
        Hide
        rogerk added a comment -

        re-target

        Show
        rogerk added a comment - re-target
        Hide
        rogerk added a comment -

        For now re-target for 2.2.
        If time permits may revisit for 2.1.

        Show
        rogerk added a comment - For now re-target for 2.2. If time permits may revisit for 2.1.
        Hide
        rogerk added a comment -

        triage

        Show
        rogerk added a comment - triage
        Hide
        Ed Burns added a comment -

        Fixed in trunk. This is a 2.2 API change and must not be back-ported to the 2.1 branch.

        Adding (bin) jsf-api/doc/changed_added_2_2.png
        Adding (bin) jsf-api/doc/changed_added_2_2_cursor.cur
        Adding (bin) jsf-api/doc/changed_deleted_2_2.png
        Adding (bin) jsf-api/doc/changed_deleted_2_2_cursor.cur
        Adding (bin) jsf-api/doc/changed_modified_2_2.png
        Adding (bin) jsf-api/doc/changed_modified_2_2_cursor.cur
        Sending jsf-api/src/main/java/javax/faces/component/UIComponent.java
        Sending jsf-api/src/main/java/javax/faces/component/package.html
        Sending jsf-api/src/main/java/javax/faces/context/FacesContext.java
        Sending jsf-api/src/main/resources/jsf-api.css
        Sending jsf-ri/conf/share/tlddoc-resources/stylesheet.css
        Sending jsf-tools/src/main/resources/com/sun/faces/generate/facesdoc/stylesheet.css
        Transmitting file data ............
        Committed revision 8944.

        Show
        Ed Burns added a comment - Fixed in trunk. This is a 2.2 API change and must not be back-ported to the 2.1 branch. Adding (bin) jsf-api/doc/changed_added_2_2.png Adding (bin) jsf-api/doc/changed_added_2_2_cursor.cur Adding (bin) jsf-api/doc/changed_deleted_2_2.png Adding (bin) jsf-api/doc/changed_deleted_2_2_cursor.cur Adding (bin) jsf-api/doc/changed_modified_2_2.png Adding (bin) jsf-api/doc/changed_modified_2_2_cursor.cur Sending jsf-api/src/main/java/javax/faces/component/UIComponent.java Sending jsf-api/src/main/java/javax/faces/component/package.html Sending jsf-api/src/main/java/javax/faces/context/FacesContext.java Sending jsf-api/src/main/resources/jsf-api.css Sending jsf-ri/conf/share/tlddoc-resources/stylesheet.css Sending jsf-tools/src/main/resources/com/sun/faces/generate/facesdoc/stylesheet.css Transmitting file data ............ Committed revision 8944.

          People

          • Assignee:
            rogerk
            Reporter:
            aschwart
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: