// JSF 2.0 the javadoc of handleNavigation() says something like this
// "...If the view has changed after an application action, call
// PartialViewContext.setRenderAll(true)...". The effect is that ajax requests
// are included on navigation.
PartialViewContext partialViewContext = facesContext.getPartialViewContext();
String viewId = facesContext.getViewRoot() != null ? facesContext.getViewRoot().getViewId() : null;
if ( partialViewContext.isPartialRequest() &&
!partialViewContext.isRenderAll() &&
toViewId != null &&
!toViewId.equals(viewId))
{
partialViewContext.setRenderAll(true);
}
// Dispose view if the view has been marked as disposable by default action listener
ViewPoolProcessor processor = ViewPoolProcessor.getInstance(facesContext);
if (processor != null &&
processor.isViewPoolEnabledForThisView(facesContext, facesContext.getViewRoot()))
{
processor.disposeView(facesContext, facesContext.getViewRoot());
}
// JSF 2.0 Spec call Flash.setRedirect(true) to notify Flash scope and take proper actions
externalContext.getFlash().setRedirect(true);
try
{
externalContext.redirect(redirectPath);
facesContext.responseComplete();
}
catch (IOException e)
{
throw new FacesException(e.getMessage(), e);
}
}
else
{
ViewHandler viewHandler = facesContext.getApplication().getViewHandler();
//create new view
String newViewId = navigationCase.getToViewId(facesContext);
// JSF 2.0 the javadoc of handleNavigation() says something like this
// "...If the view has changed after an application action, call
// PartialViewContext.setRenderAll(true)...". The effect is that ajax requests
// are included on navigation.
PartialViewContext partialViewContext = facesContext.getPartialViewContext();
String viewId = facesContext.getViewRoot() != null ? facesContext.getViewRoot().getViewId() : null;
if ( partialViewContext.isPartialRequest() &&
!partialViewContext.isRenderAll() &&
newViewId != null &&
!newViewId.equals(viewId))
{
partialViewContext.setRenderAll(true);
}
if (facesContext.getViewRoot() != null &&
facesContext.getViewRoot().getAttributes().containsKey("oam.CALL_PRE_DISPOSE_VIEW"))
{