code: private void _invokeViewRootAfterPhaseListener(FacesContext facesContext)
      {
          // get the UIViewRoot (note that it must not be null at this point)
          UIViewRoot root = facesContext.getViewRoot();
          MethodExpression afterPhaseExpression = root.getAfterPhaseListener();
          if (afterPhaseExpression != null)
          {
              PhaseEvent event = new PhaseEvent(facesContext, getPhase(), _getLifecycle(facesContext));
              try
              {
                  afterPhaseExpression.invoke(facesContext.getELContext(), new Object[] { event });
              }
              catch (Throwable t) 
              {
                  log.log(Level.SEVERE, "An Exception occured while processing " +
                          afterPhaseExpression.getExpressionString() + 
                          " in Phase " + getPhase(), t);
              }
          }
      }
docs: Invoke afterPhase MethodExpression of UIViewRoot.
  Note: In this phase it is not possible to invoke the beforePhase method, because we
  first have to restore the view to get its attributes. Also it is not really possible
  to call the afterPhase method inside of UIViewRoot for this phase, thus it was decided
  in the JSF 2.0 spec rev A to put this here.
  @param facesContext