From 13b05e984b1c070f32c9011713af29d1a1bb0fc7 Mon Sep 17 00:00:00 2001 From: Jeremy Grelle Date: Wed, 14 Jan 2009 22:31:17 +0000 Subject: [PATCH] SWF-1000 - JsfViewFactory not correctly checking if viewAlreadySet --- .../org/springframework/faces/webflow/JsfViewFactory.java | 6 +++--- 1 file changed, 3 insertions(+), 3 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 92e71617..0e2ad221 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 @@ -80,7 +80,7 @@ public class JsfViewFactory implements ViewFactory { } JsfView view; String viewName = (String) viewIdExpression.getValue(context); - if (viewAlreadySet(facesContext)) { + if (viewAlreadySet(facesContext, viewName)) { if (logger.isDebugEnabled()) { logger.debug("Existing view root found with id '" + facesContext.getViewRoot().getId() + "'"); } @@ -129,8 +129,8 @@ public class JsfViewFactory implements ViewFactory { } } - private boolean viewAlreadySet(FacesContext facesContext) { - if (facesContext.getViewRoot() != null) { + private boolean viewAlreadySet(FacesContext facesContext, String viewName) { + if (facesContext.getViewRoot() != null && facesContext.getViewRoot().getViewId().equals(viewName)) { // the corner case where a before RESTORE_VIEW PhaseListener has handled setting the UIViewRoot return true; } else {