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

Spec compliance: managed-beans do not support List properties that are write-only

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.1.1
    • 1.1.2
    • JSR-127
    • None
    • All.

    Description

      If you use <list-entries> for a property that has only a setter, you get a FacesException thrown
      as a result of ManagedBeanBuilder.initializeProperties() calling PropertyResolver.getValue().

      However, the spec is clear that this scenario is supported; see 5.3.1.3:

      For <list-entries>:
      1. Call the property getter, if it exists.
      2. If the getter returns null or doesn't exist, create a java.util.ArrayList,
      otherwise use the returned Object (an array or a java.util.List).
      (etc.)

      Note that <map-entries> has the same language, and therefore the
      same bug exists in MyFaces.

      The above behavior is properly implemented by the RI.

      Generally speaking, there is a problem that the managed bean facility is attempting to
      use PropertyResolver - which is cool, and which the spec should have done in
      retrospect - but I think is illegal, since it implies functionality and extensibility that is not
      stated in the spec, and language like the above for list-entries more-or-less implies
      that PropertyResolver is not used.

      Attachments

        1. impl.test.txt
          10 kB
          Dennis Christopher Byrne
        2. impl.txt
          2 kB
          Dennis Christopher Byrne
        3. share.test.txt
          0.8 kB
          Dennis Christopher Byrne

        Activity

          People

            mmarinschek Martin Marinschek
            adamwiner Adam Winer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: