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

Support collection of records in PushContext#send

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 5.0.0
    • 5.0.0, 4.1.0-RC3
    • None
    • None

    Description

      Originally brought up via https://github.com/OpenLiberty/open-liberty/issues/26854

      PushContext#send(Object obj) does not support collections of Records (added in Java 14). Currently, empty JSON objects are returned.  This problem occurs within Json encoding logic.

      https://github.com/apache/myfaces/blob/main/impl/src/main/java/org/apache/myfaces/push/Json.java#L80-L118

      Json.encode will go through all the type checks linked above and since none of them match, the last one (encodeBean) will be chosen. However, this simply results in an empty JSON responses ( such as [ {}, {}, {} ]).

      Only work around I see for how is to call toString on the collection instead.

      Attachments

        Activity

          People

            volosied Volodymyr Siedlecki
            volosied Volodymyr Siedlecki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: