You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Gerhard Petracek (JIRA)" <de...@myfaces.apache.org> on 2008/07/11 14:50:31 UTC

[jira] Created: (MYFACES-1894) events aren't cleared

events aren't cleared
---------------------

                 Key: MYFACES-1894
                 URL: https://issues.apache.org/jira/browse/MYFACES-1894
             Project: MyFaces Core
          Issue Type: Bug
          Components: JSR-252
    Affects Versions: 1.2.3, 1.2.2,  1.2.0, 1.2.4-SNAPSHOT
            Reporter: Gerhard Petracek


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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MYFACES-1894) events aren't cleared

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12619275#action_12619275 ] 

Leonardo Uribe commented on MYFACES-1894:
-----------------------------------------

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.

> events aren't cleared
> ---------------------
>
>                 Key: MYFACES-1894
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1894
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-252
>    Affects Versions:  1.2.0, 1.2.2, 1.2.3, 1.2.4-SNAPSHOT
>            Reporter: Gerhard Petracek
>
> see section 4.1.17.3
> (it's correct in myfaces-core 1.1.x)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.