Sorry, I let this one site for a while. From the jsr314-comments.org inbox.

-Dan

---------- Forwarded message ----------
From: Jakob Korherr <jakob.korherr@gmail.com>
Date: Tue, Oct 27, 2009 at 4:07 PM
Subject: [jsf 2.0] UIViewRoot afterPhase
To: jsr-314-comments@jcporg
Cc: MyFaces Development <dev@myfaces.apache.org>

Hi,

While working on MYFACES-2374 "UIViewRoot.getBeforePhaseListener() and UIViewRoot.getAfterPhaseListener() could be called on PhaseId.RESTORE_VIEW", I found out that the mojarra javadoc was changed, so that only UIViewRoot.getAfterPhaseListener should be called on RESTORE_VIEW.

Mojarra javadoc on UIViewRoot.setAfterPhaseListener says: "Allow an arbitrary method to be called for the "afterPhase" event as the UIViewRoot runs through its lifecycle. This method will be called for all phases including PhaseId.RESTORE_VIEW."
Just a week ago UIViewRoot.setBeforePhaseListener also said "...for all phases including PhaseId.RESTORE_VIEW.", now it says "...except PhaseId.RESTORE_VIEW."

It is clear to me, why this was changed, because you have to restore the view before you can access the attributes, not really difficult to see.
But why should we still call UIViewRoot.getAfterPhaseListener on RESTORE_VIEW?

Spec says that we should only call an afterPhase method, if the relating beforePhase method returned without an Exception. Of course, these attributes of UIViewRoot are different to its "normal" PhaseListeners, but I think that this behaviour is kind of strange.
Why don't we change it back to the way it was in jsf 1.2? So that UIViewRoot.getBeforePhaseListener AND UIViewRoot.getAfterPhaseListener are called for all phases except RESTORE_VIEW.

Also: Mojarra 2.0.1 does not call UIViewRoot.setAfterPhaseListener on RESTORE_VIEW.

Thanks in advance.

Regards

Jakob Korherr