From 4035f581d1fbd1bb72b857d9f7f6ea1bc678bda6 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Tue, 22 Apr 2008 04:50:25 +0000 Subject: [PATCH] viewAlreadySet(FacesContext) -- viewId not needed? --- .../springframework/faces/webflow/JsfViewFactory.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java index 81becdf7..b960fbdf 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfViewFactory.java @@ -74,9 +74,9 @@ public class JsfViewFactory implements ViewFactory { } JsfView view; String viewName = resolveViewName(context); - if (viewAlreadySet(facesContext, viewName)) { + if (viewAlreadySet(facesContext)) { if (logger.isDebugEnabled()) { - logger.debug("Existing view root found for '" + viewName + "'"); + logger.debug("Existing view root found with id '" + facesContext.getViewRoot().getId() + "'"); } view = createJsfView(facesContext.getViewRoot(), lifecycle, context); view.setRestored(true); @@ -106,9 +106,9 @@ public class JsfViewFactory implements ViewFactory { } } - private boolean viewAlreadySet(FacesContext facesContext, String viewId) { - if (facesContext.getViewRoot() != null && facesContext.getViewRoot().getViewId().equals(viewId)) { - // the corner case where a BEFORE_VIEW PhaseListener has handled setting the UIViewRoot + private boolean viewAlreadySet(FacesContext facesContext) { + if (facesContext.getViewRoot() != null && facesContext.getViewRoot() != null) { + // the corner case where a before RESTORE_VIEW PhaseListener has handled setting the UIViewRoot return true; } else { return false;