diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java index 7f40eeb1..82d1aa02 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfView.java @@ -106,10 +106,6 @@ public class JsfView implements View { */ public void processUserEvent() { FacesContext facesContext = FlowFacesContext.getCurrentInstance(); - - // Ensure serialized view state is always updated even if JSF didn't call StateManager.writeState(). SWF-1577 - saveState(); - // Must respect these flags in case user set them during RESTORE_VIEW phase if (!facesContext.getRenderResponse() && !facesContext.getResponseComplete()) { this.facesLifecycle.execute(facesContext); @@ -127,8 +123,11 @@ public class JsfView implements View { } public Serializable getUserEventState() { - // Set the temporary UIViewRoot state so that it will be available across the redirect (see comments in render() - // method) + // Set the temporary UIViewRoot state so that it will be available across the redirect (see comments in render() method) + + // Ensure serialized view state is always updated even if JSF didn't call StateManager.writeState(). SWF-1577 + saveState(); + return new ViewRootHolder(getViewRoot()); }