render from end-state bug fix for mvc and jsf
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
|
||||
<info organisation="org.springframework.webflow" module="${ant.project.name}">
|
||||
<license name="Apache 2.0" url="http://www.apache.org/licenses/LICENSE-2.0"/>
|
||||
<ivyauthor name="Jeremy Grelle"/>
|
||||
</info>
|
||||
|
||||
<configurations>
|
||||
|
||||
@@ -6,25 +6,7 @@
|
||||
<artifactId>org.springframework.faces</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Spring Faces</name>
|
||||
<version>2.0.2.RELEASE</version>
|
||||
<description>Spring's module for developing rich web applications using JSF</description>
|
||||
<url>http://www.springframework.org</url>
|
||||
<licenses>
|
||||
<license>
|
||||
<name>The Apache Software License, Version 2.0</name>
|
||||
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
|
||||
<distribution>repo</distribution>
|
||||
</license>
|
||||
</licenses>
|
||||
<scm>
|
||||
<connection>scm:svn:https://svn.sourceforge.net/svnroot/springframework/spring-webflow</connection>
|
||||
<developerConnection>scm:svn:https://svn.sourceforge.net/svnroot/springframework/spring-webflow</developerConnection>
|
||||
<url>http://svn.sourceforge.net/viewcvs.cgi/springframework/spring-webflow</url>
|
||||
</scm>
|
||||
<organization>
|
||||
<name>Spring Framework</name>
|
||||
<url>http://www.springframework.org/</url>
|
||||
</organization>
|
||||
<version>2.0.3.RELEASE</version>
|
||||
<dependencies>
|
||||
<!-- global dependencies -->
|
||||
<dependency>
|
||||
@@ -35,27 +17,27 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
<version>2.5.4</version>
|
||||
<version>2.5.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>2.5.4</version>
|
||||
<version>2.5.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>2.5.4</version>
|
||||
<version>2.5.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>2.5.4</version>
|
||||
<version>2.5.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>2.5.4</version>
|
||||
<version>2.5.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.webflow</groupId>
|
||||
|
||||
@@ -85,10 +85,6 @@ public class FlowViewStateManager extends StateManager {
|
||||
return super.restoreTreeStructure(context, viewId, renderKitId);
|
||||
}
|
||||
RequestContext requestContext = RequestContextHolder.getRequestContext();
|
||||
if (!requestContext.inViewState()) {
|
||||
logger.debug("Not in a view state; no state to restore");
|
||||
return null;
|
||||
}
|
||||
SerializedView view = (SerializedView) requestContext.getViewScope().get(SERIALIZED_VIEW_STATE);
|
||||
if (view == null || !view.viewId.equals(viewId)) {
|
||||
logger.debug("No matching view in view scope");
|
||||
|
||||
@@ -93,15 +93,24 @@ public class JsfViewFactory implements ViewFactory {
|
||||
view = createJsfView(facesContext.getViewRoot(), lifecycle, context);
|
||||
view.setRestored(true);
|
||||
} else {
|
||||
UIViewRoot viewRoot = viewHandler.restoreView(facesContext, viewName);
|
||||
if (viewRoot != null) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("View root restored for '" + viewName + "'");
|
||||
if (context.inViewState()) {
|
||||
UIViewRoot viewRoot = viewHandler.restoreView(facesContext, viewName);
|
||||
if (viewRoot != null) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("View root restored for '" + viewName + "'");
|
||||
}
|
||||
view = createJsfView(viewRoot, lifecycle, context);
|
||||
facesContext.setViewRoot(view.getViewRoot());
|
||||
processTree(facesContext, view.getViewRoot());
|
||||
view.setRestored(true);
|
||||
} else {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Creating view root for '" + viewName + "'");
|
||||
}
|
||||
view = createJsfView(viewHandler.createView(facesContext, viewName), lifecycle, context);
|
||||
facesContext.setViewRoot(view.getViewRoot());
|
||||
view.setRestored(false);
|
||||
}
|
||||
view = createJsfView(viewRoot, lifecycle, context);
|
||||
facesContext.setViewRoot(view.getViewRoot());
|
||||
processTree(facesContext, view.getViewRoot());
|
||||
view.setRestored(true);
|
||||
} else {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Creating view root for '" + viewName + "'");
|
||||
|
||||
@@ -86,6 +86,8 @@ public class JsfFinalResponseActionTests extends TestCase {
|
||||
newRoot.setViewId(VIEW_ID);
|
||||
newRoot.setRenderKitId("HTML_BASIC");
|
||||
((MockViewHandler) viewHandler).setCreateView(newRoot);
|
||||
context.inViewState();
|
||||
EasyMock.expectLastCall().andReturn(Boolean.FALSE);
|
||||
|
||||
EasyMock.replay(new Object[] { context });
|
||||
|
||||
|
||||
@@ -102,6 +102,8 @@ public class JsfViewFactoryTests extends TestCase {
|
||||
UIViewRoot newRoot = new UIViewRoot();
|
||||
newRoot.setViewId(VIEW_ID);
|
||||
((MockViewHandler) viewHandler).setCreateView(newRoot);
|
||||
context.inViewState();
|
||||
EasyMock.expectLastCall().andReturn(Boolean.TRUE);
|
||||
|
||||
EasyMock.replay(new Object[] { context });
|
||||
|
||||
@@ -130,6 +132,9 @@ public class JsfViewFactoryTests extends TestCase {
|
||||
existingRoot.getChildren().add(input);
|
||||
((MockViewHandler) viewHandler).setRestoreView(existingRoot);
|
||||
|
||||
context.inViewState();
|
||||
EasyMock.expectLastCall().andReturn(Boolean.TRUE);
|
||||
|
||||
EasyMock.replay(new Object[] { context });
|
||||
|
||||
View restoredView = factory.getView(context);
|
||||
@@ -171,6 +176,9 @@ public class JsfViewFactoryTests extends TestCase {
|
||||
|
||||
((MockViewHandler) viewHandler).setRestoreView(existingRoot);
|
||||
|
||||
context.inViewState();
|
||||
EasyMock.expectLastCall().andReturn(Boolean.TRUE);
|
||||
|
||||
EasyMock.replay(new Object[] { context });
|
||||
|
||||
View restoredView = factory.getView(context);
|
||||
@@ -201,6 +209,9 @@ public class JsfViewFactoryTests extends TestCase {
|
||||
|
||||
EasyMock.expect(context.getCurrentState()).andReturn(new NormalViewState());
|
||||
|
||||
context.inViewState();
|
||||
EasyMock.expectLastCall().andReturn(Boolean.TRUE);
|
||||
|
||||
EasyMock.replay(new Object[] { context });
|
||||
|
||||
View restoredView = factory.getView(context);
|
||||
|
||||
Reference in New Issue
Block a user