diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/ViewState.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/ViewState.java index ec25c367..df2d5b8d 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/ViewState.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/ViewState.java @@ -167,28 +167,16 @@ public class ViewState extends TransitionableState { } protected void doEnter(RequestControlContext context) throws FlowExecutionException { - ViewState originatingViewState = (ViewState) context.getRequestScope().get("webflow.originatingViewState"); - if (this == originatingViewState) { - if (context.getExternalContext().isResponseAllowed()) { - if (context.getExternalContext().isAjaxRequest()) { - View view = viewFactory.getView(context); - render(context, view); - } else { - context.getExternalContext().requestFlowExecutionRedirect(); - } - } - } else { - context.assignFlowExecutionKey(); - if (context.getExternalContext().isResponseAllowed()) { - if (shouldRedirect(context)) { - context.getExternalContext().requestFlowExecutionRedirect(); - if (popup) { - context.getExternalContext().requestRedirectInPopup(); - } - } else { - View view = viewFactory.getView(context); - render(context, view); + context.assignFlowExecutionKey(); + if (context.getExternalContext().isResponseAllowed()) { + if (shouldRedirect(context)) { + context.getExternalContext().requestFlowExecutionRedirect(); + if (popup) { + context.getExternalContext().requestRedirectInPopup(); } + } else { + View view = viewFactory.getView(context); + render(context, view); } } } diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewStateTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewStateTests.java index b6b97cc8..2336e345 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewStateTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/ViewStateTests.java @@ -118,28 +118,6 @@ public class ViewStateTests extends TestCase { assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested()); } - public void testEnterViewStateReturningToSameOriginatingStateNonAjax() { - Flow flow = new Flow("myFlow"); - StubViewFactory viewFactory = new StubViewFactory(); - ViewState state = new ViewState(flow, "viewState", viewFactory); - MockRequestControlContext context = new MockRequestControlContext(flow); - context.getRequestScope().put("webflow.originatingViewState", state); - state.enter(context); - assertFalse("Render called", context.getFlowScope().contains("renderCalled")); - assertTrue(context.getMockExternalContext().getFlowExecutionRedirectRequested()); - } - - public void testEnterViewStateReturningToSameOriginatingStateAjax() { - Flow flow = new Flow("myFlow"); - StubViewFactory viewFactory = new StubViewFactory(); - ViewState state = new ViewState(flow, "viewState", viewFactory); - MockRequestControlContext context = new MockRequestControlContext(flow); - context.getMockExternalContext().setAjaxRequest(true); - context.getRequestScope().put("webflow.originatingViewState", state); - state.enter(context); - assertTrue("Render called", context.getFlowScope().contains("renderCalled")); - } - public void testResumeViewStateForRefresh() { Flow flow = new Flow("myFlow"); StubViewFactory viewFactory = new StubViewFactory();