Uploaded image for project: 'MyFaces Orchestra'
  1. MyFaces Orchestra
  2. ORCHESTRA-29

Make access-scope work with ajax frameworks that "render" during beforePhase of a PhaseListener

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Conversation
    • Labels:
      None

      Description

      As reported by Petr Juza, there is a problem with the NetAdvantage ajax library and orchestra access-scoped conversations.

      Orchestra's AccessScopePhaseListener runs for the RENDER_RESPONSE phase. In beforePhase it clears the "accessed" flag of all conversations, and then in afterPhase it discards conversations that are not accessed. In other words, it expects rendering to occur between its beforePhase and afterPhase are run.

      However in the NetAdvantage ajax framework (and possibly others) it appears that the ajax equivalent of "rendering" is done by a PhaseListener's beforePhase code, and that the PhaseListener then calls facesContext.responseComplete to block normal rendering. In other words, these ajax frameworks effectively move "rendering" (including access to all the beans) earlier in time than normal JSF processing.

      In this situation, if the Orchestra PhaseListener is registered first, then all works fine. But if it gets registered after the ajax phase listener, then the accesses to conversation-scoped beans all occur before its beforePhase (where the access flags are cleared). So at afterPhase no conversations appear to be accessed.

      I don't think this qualifies as an Orchestra bug; moving rendering out of its normal time is the problem.

      However the obvious solution is for Orchestra to somehow clear access flags at the very start of the render phase, before any PhaseListener objects are run.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              skitching Simon Kitching
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: