The JavaDoc for FacesContext.setViewRoot() currently say:
"Set the root component that is associated with this request. This method can only be called by the
application handler (or a class that the handler calls), and only during the Invoke Application phase of
the request processing lifecycle."
However, JSF itself calls setViewRoot() during the restore view phase, which conflicts with the above
statement. In addition, we have been recommending the use of the PreRenderView events as a
substitute for view actions until view actions can be added in JSF 2.1. Navigation in response to
PreRenderView events would also contradict the above statement.
We need to re-evaluate what restrictions should apply to setViewRoot() (and, by extension,
NavigationHandler.handleNavigation() and ConfigurableNavigation.performNavigation()).