diff --git a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowExecutionHolderUtils.java b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowExecutionHolderUtils.java index 0bff6d69..2ec4eb05 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowExecutionHolderUtils.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowExecutionHolderUtils.java @@ -28,7 +28,6 @@ import org.springframework.webflow.execution.FlowExecution; * {@link FacesContext}'s {@link ExternalContext#getRequestMap()}. * * @author Keith Donald - * @author Craig McClanahan */ public class FlowExecutionHolderUtils { @@ -92,13 +91,15 @@ public class FlowExecutionHolderUtils { } /** - * Unlocks the current flow execution in the faces context if necessary. - * Can be safely called even if no execution is bound or one is bound but not locked. + * Cleans up the current flow execution in the faces context if necessary. + * Specifically, handles unlocking the execution if necessary and setting the + * holder to null. * @param context the faces context */ - public static void unlockCurrentFlowExecutionIfNecessary(FacesContext context) { + public static void cleanupCurrentFlowExecution(FacesContext context) { if (isFlowExecutionRestored(context)) { getFlowExecutionHolder(context).unlockFlowExecutionIfNecessary(); + context.getExternalContext().getRequestMap().remove(getFlowExecutionHolderKey()); } } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowNavigationHandler.java b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowNavigationHandler.java index 74f27d42..230cd7c5 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowNavigationHandler.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowNavigationHandler.java @@ -246,7 +246,7 @@ public class FlowNavigationHandler extends DecoratingNavigationHandler { if (logger.isDebugEnabled()) { logger.debug("Cleaning up allocated flow system resources"); } - FlowExecutionHolderUtils.unlockCurrentFlowExecutionIfNecessary(context); + FlowExecutionHolderUtils.cleanupCurrentFlowExecution(context); ExternalContextHolder.setExternalContext(null); } } \ No newline at end of file diff --git a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPhaseListener.java b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPhaseListener.java index 7e9ff9d4..02c02817 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPhaseListener.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/executor/jsf/FlowPhaseListener.java @@ -481,7 +481,7 @@ public class FlowPhaseListener implements PhaseListener { if (logger.isDebugEnabled()) { logger.debug("Cleaning up allocated flow system resources"); } - FlowExecutionHolderUtils.unlockCurrentFlowExecutionIfNecessary(context); + FlowExecutionHolderUtils.cleanupCurrentFlowExecution(context); ExternalContextHolder.setExternalContext(null); }