Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.0, 1.2.2, 1.2.3, 1.2.4-SNAPSHOT
    • Fix Version/s: 1.2.4
    • Component/s: JSR-252
    • Labels:
      None

      Description

      see section 4.1.17.3
      (it's correct in myfaces-core 1.1.x)

        Activity

        Gerhard Petracek created issue -
        Hide
        Leonardo Uribe added a comment -

        The problem is here:

        private boolean process(FacesContext context, PhaseId phaseId, Processor processor, boolean broadcast)
        {
        if (!notifyListeners(context, phaseId, getBeforePhaseListener(), true))
        {
        if (processor != null)
        processor.process();

        if (broadcast)
        {
        _broadcastForPhase(phaseId);
        if (context.getRenderResponse() || context.getResponseComplete())

        { clearEvents(); }

        }
        }
        return notifyListeners(context, phaseId, getAfterPhaseListener(), false);
        }

        This method is called on all processXXXX methods.

        The error use case occur when some phaseListener is executed and causes renderResponse or responseComplete. In that case the code that clear the event list is skipped (this does not happens on myfaces core 1.1.x.

        The solution is do something like this:

        private boolean process(FacesContext context, PhaseId phaseId, Processor processor, boolean broadcast)
        {
        if (!notifyListeners(context, phaseId, getBeforePhaseListener(), true))
        {
        if (processor != null)
        processor.process();

        if (broadcast)

        { _broadcastForPhase(phaseId); }

        }
        if (context.getRenderResponse() || context.getResponseComplete())

        { clearEvents(); }

        return notifyListeners(context, phaseId, getAfterPhaseListener(), false);
        }

        this code keeps the myfaces core 1.1.x behavior, which is correct.

        Show
        Leonardo Uribe added a comment - The problem is here: private boolean process(FacesContext context, PhaseId phaseId, Processor processor, boolean broadcast) { if (!notifyListeners(context, phaseId, getBeforePhaseListener(), true)) { if (processor != null) processor.process(); if (broadcast) { _broadcastForPhase(phaseId); if (context.getRenderResponse() || context.getResponseComplete()) { clearEvents(); } } } return notifyListeners(context, phaseId, getAfterPhaseListener(), false); } This method is called on all processXXXX methods. The error use case occur when some phaseListener is executed and causes renderResponse or responseComplete. In that case the code that clear the event list is skipped (this does not happens on myfaces core 1.1.x. The solution is do something like this: private boolean process(FacesContext context, PhaseId phaseId, Processor processor, boolean broadcast) { if (!notifyListeners(context, phaseId, getBeforePhaseListener(), true)) { if (processor != null) processor.process(); if (broadcast) { _broadcastForPhase(phaseId); } } if (context.getRenderResponse() || context.getResponseComplete()) { clearEvents(); } return notifyListeners(context, phaseId, getAfterPhaseListener(), false); } this code keeps the myfaces core 1.1.x behavior, which is correct.
        Leonardo Uribe made changes -
        Field Original Value New Value
        Fix Version/s 1.2.4-SNAPSHOT [ 12313145 ]
        Status Open [ 1 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Assignee Leonardo Uribe [ lu4242 ]
        Leonardo Uribe made changes -
        Fix Version/s 1.2.4-SNAPSHOT [ 12313145 ]
        Fix Version/s 1.2.4 [ 12313378 ]

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Gerhard Petracek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development