diff --git a/build-spring-webflow/resources/changelog.txt b/build-spring-webflow/resources/changelog.txt index 7b453d44..dbaa0355 100644 --- a/build-spring-webflow/resources/changelog.txt +++ b/build-spring-webflow/resources/changelog.txt @@ -5,8 +5,20 @@ http://www.springframework.org/webflow Changes in version 2.4.0.RELEASE ----------------------------------------------- - - +Changes in version 2.3.1.RELEASE (Mar 27, 2012) +----------------------------------------------- +Upgrade Spring to version 3.1.1 +Upgrade JSF Mojarra version to 2.1.7 +Modify Jsf2FlowFacesContext.isValidationFailed() to check Web Flow's MessageContext for errors +Recognize class-level bean validation messages in BindingResult.getGlobalErrors() +Ensure "embedded" mode is flow session local, i.e. specific to a specific flow or subflow +Allow JSF view root to survive redirect in same state (following fix in JSF Mojarra 2.1) +Ensure PostRestoreStateEvent is delivered to registered listeners +Upgrade booking-faces sample to use PrimeFaces 3.1.1 +Fix NullPointerException in FlowViewStateManager when not in a flow request +Move source code to http://github.com/SpringSource/spring-webflow +Modify FlowPartialViewContext to return a modifiable List to comply with its contract +Check request parameter in addition to request header to recognize JSF 2 Ajax requests. Changes in version 2.3.0.RELEASE (Feb 28, 2011) ----------------------------------------------- diff --git a/build-spring-webflow/resources/readme.txt b/build-spring-webflow/resources/readme.txt index a3218721..60f9794c 100644 --- a/build-spring-webflow/resources/readme.txt +++ b/build-spring-webflow/resources/readme.txt @@ -78,33 +78,25 @@ For an exact list of project dependencies, see each project's ivy file at "proje ------------------ This distribution contains documentation and sample applications demonstrating the features of the Spring Web Flow projects. A great way to get started is to review and run the sample applications, supplementing with reference manual material as you go. -To build deployable .war files for all samples, simply access the projects/build-spring-webflow directory and run ant. -All projects are directly importable into Eclipse as "Dynamic Web Projects". -See http://www.springframework.org/webflow-samples for more information. +To build deployable .war files for the samples, access the projects/spring-webflow-samples directory and run "mvn package". +Sample projects can be imported into an IDE as Maven projects or by generating IDE settings (e.g. "mvn eclipse:eclipse"). -5. OBTAINING RELEASE JARS FROM THE SPRINGSOURCE BUNDLE REPOSITORY ------------------------------------------------------------------ -Each jar in the Web Flow distribution is available in the SpringSource release repository. -These jars may be accessed using Maven or Ivy dependency managers. -Browse the contents of the repository by accessing http://www.springsource.com/repository. +5. OBTAINING RELEASE JARS WITH MAVEN OR IVY +------------------------------------------- +Release versions of Spring Web Flow artifacts are available via Maven Central. -To access jars using Maven, add the following repositories to your Maven pom: +For milestones and snapshots only (and for Ivy dependencies) you'll need to use the +SpringSource repository. Add the following repository to your Maven pom.xml: - com.springsource.repository.bundles.release - SpringSource Enterprise Bundle Repository - SpringSource Releases - http://repository.springsource.com/maven/bundles/release + springsource-repository + Spring project releases, milestones, and snapshots + http://repo.springsource.org/snapshot - - com.springsource.repository.bundles.external - SpringSource Enterprise Bundle Repository - External Releases - http://repository.springsource.com/maven/bundles/external - - -Then declare the following dependencies (note that many times it's sufficient to include -org.springframework.webflow only, which will give you org.springframework.binding, -org.springframework.js, and org.springframework.js via transitive dependencies): +Then declare the following dependencies (note that many times it's sufficient +to include spring-webflow only, which will give you spring-binding and spring-js +via transitive dependencies): org.springframework.webflow @@ -124,7 +116,7 @@ org.springframework.js, and org.springframework.js via transitive dependencies): 2.4.0.RELEASE -If using JavaServerFaces all you need to include is: +If using JSF all you need to include is: org.springframework.webflow @@ -154,21 +146,14 @@ If using JavaServerFaces: -Refer to the reference documentation for more coverage on obtaining Web Flow jars using Maven or Ivy. +For more information see the reference documentation and the SpringSource Repository FAQ: +https://github.com/SpringSource/spring-framework/wiki/SpringSource-repository-FAQ 6. ADDITIONAL RESOURCES ----------------------- The Spring Web Flow homepage is located at: - http://www.springframework.org/webflow - -There you will find resources such as a 'Quick Start' guide and a 'Frequently Asked Questions' section. + http://www.springsource.org/spring-web-flow The Spring Web Flow community forums are located at: http://forum.springframework.org - -There you will find an active community of users collaborating about the project. -The Spring Community portal is located at: - http://www.springframework.org - -There you will find links to many resources on Spring Portfolio projects, including on-line access to Spring documentation. diff --git a/spring-binding/.classpath b/spring-binding/.classpath index 6e8d7986..cbf9c8f8 100644 --- a/spring-binding/.classpath +++ b/spring-binding/.classpath @@ -3,20 +3,17 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/spring-binding/ivy.xml b/spring-binding/ivy.xml index e6d58dfb..87bb87be 100644 --- a/spring-binding/ivy.xml +++ b/spring-binding/ivy.xml @@ -23,10 +23,10 @@ - - - - + + + + diff --git a/spring-binding/pom.xml b/spring-binding/pom.xml index 8086c2b9..a737b485 100644 --- a/spring-binding/pom.xml +++ b/spring-binding/pom.xml @@ -125,6 +125,6 @@ - 3.0.5.RELEASE + 3.1.1.RELEASE diff --git a/spring-binding/src/main/java/org/springframework/binding/message/Message.java b/spring-binding/src/main/java/org/springframework/binding/message/Message.java index bc3909c5..4b7ba94a 100644 --- a/spring-binding/src/main/java/org/springframework/binding/message/Message.java +++ b/spring-binding/src/main/java/org/springframework/binding/message/Message.java @@ -18,6 +18,7 @@ package org.springframework.binding.message; import java.io.Serializable; import org.springframework.core.style.ToStringCreator; +import org.springframework.util.StringUtils; /** * An object of communication that provides text information. For example, a validation message may inform a web @@ -49,7 +50,8 @@ public class Message implements Serializable { /** * A reference to the source element this message is associated with. This could be a field on a form in UI, or null - * if the message is not associated with a any particular element. + * (or empty "" in the case of global bean validation) if the message is not associated with a any particular + * element. * @return the source */ public Object getSource() { @@ -72,6 +74,18 @@ public class Message implements Serializable { return severity; } + /** + * Whether the message is associated with a field. + * @return {@code true} if the source is a String that has text; {@code false} otherwise. + */ + public boolean hasField() { + if (this.source instanceof String) { + return StringUtils.hasText((String) this.source); + } else { + return false; + } + } + public String toString() { return new ToStringCreator(this).append("source", source).append("severity", severity).append("text", text) .toString(); diff --git a/spring-binding/src/main/java/overview.html b/spring-binding/src/main/java/overview.html deleted file mode 100644 index 1eb7a2e8..00000000 --- a/spring-binding/src/main/java/overview.html +++ /dev/null @@ -1,7 +0,0 @@ - - -

-The Spring Data Binding framework, an internal library used by Spring Web Flow. -

- - \ No newline at end of file diff --git a/spring-binding/src/test/java/org/springframework/binding/expression/spel/ELExpressionParserCompatibilityTests.java b/spring-binding/src/test/java/org/springframework/binding/expression/spel/ELExpressionParserCompatibilityTests.java index d29b8ea4..955ba3e6 100644 --- a/spring-binding/src/test/java/org/springframework/binding/expression/spel/ELExpressionParserCompatibilityTests.java +++ b/spring-binding/src/test/java/org/springframework/binding/expression/spel/ELExpressionParserCompatibilityTests.java @@ -107,8 +107,8 @@ public class ELExpressionParserCompatibilityTests extends TestCase { public void testParseBeanEvalExpressionInvalidELVariable() { try { String expressionString = "bogus"; - Expression exp = parser.parseExpression(expressionString, new FluentParserContext() - .evaluate(TestBean.class)); + Expression exp = parser.parseExpression(expressionString, + new FluentParserContext().evaluate(TestBean.class)); exp.getValue(new TestBean()); fail("Should have failed"); } catch (EvaluationException e) { @@ -131,8 +131,8 @@ public class ELExpressionParserCompatibilityTests extends TestCase { public void testParseTemplateExpressionWithVariables() { String expressionString = "#{value}#{#max}"; - Expression exp = parser.parseExpression(expressionString, new FluentParserContext().template().variable( - new ExpressionVariable("max", "maximum"))); + Expression exp = parser.parseExpression(expressionString, + new FluentParserContext().template().variable(new ExpressionVariable("max", "maximum"))); TestBean target = new TestBean(); assertEquals("foo2", exp.getValue(target)); // TODO: } @@ -147,7 +147,8 @@ public class ELExpressionParserCompatibilityTests extends TestCase { String expressionString = "maximum"; Expression exp = parser.parseExpression(expressionString, null); TestBean context = new TestBean(); - assertEquals(int.class, exp.getValueType(context)); + Class clazz = exp.getValueType(context); + assertTrue(int.class.equals(clazz) || Integer.class.equals(clazz)); } public void testGetValueWithCoersion() { @@ -159,8 +160,8 @@ public class ELExpressionParserCompatibilityTests extends TestCase { public void testGetValueCoersionError() { String expressionString = "maximum"; - Expression exp = parser.parseExpression(expressionString, new FluentParserContext() - .expectResult(TestBean.class)); + Expression exp = parser.parseExpression(expressionString, + new FluentParserContext().expectResult(TestBean.class)); TestBean context = new TestBean(); try { exp.getValue(context); @@ -202,8 +203,8 @@ public class ELExpressionParserCompatibilityTests extends TestCase { } public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException { - return new TypedValue("Custom resolver resolved this special property!", TypeDescriptor - .valueOf(String.class)); + return new TypedValue("Custom resolver resolved this special property!", + TypeDescriptor.valueOf(String.class)); } public Class[] getSpecificTargetClasses() { diff --git a/spring-binding/template.mf b/spring-binding/template.mf index d82b70ae..f8a22b89 100644 --- a/spring-binding/template.mf +++ b/spring-binding/template.mf @@ -6,7 +6,7 @@ Import-Package: ognl;version="[2.6.9, 3.0.0)";resolution:=optional, org.jboss.el;version="[2.0.0, 3.0.0)";resolution:=optional Import-Template: - org.springframework.*;version="[3.0.5.RELEASE, 3.1.0)", + org.springframework.*;version="[3.1.0.RELEASE, 3.2.0)", org.apache.commons.logging;version="[1.1.1, 2.0.0)", javax.el;version="[1.0.0, 2.0.0)";resolution:=optional, ognl;version="[2.6.9, 3.0.0)";resolution:=optional, diff --git a/spring-build/common/common.xml b/spring-build/common/common.xml index 4973529a..690cc193 100644 --- a/spring-build/common/common.xml +++ b/spring-build/common/common.xml @@ -237,4 +237,4 @@ - \ No newline at end of file + diff --git a/spring-build/multi-bundle/common.xml b/spring-build/multi-bundle/common.xml index e1d72134..26b311ac 100644 --- a/spring-build/multi-bundle/common.xml +++ b/spring-build/multi-bundle/common.xml @@ -104,7 +104,7 @@ + stylesheetfile="${javadoc.stylesheet.file}" splitindex="true" useexternalfile="true" overview="@{input.dir}/overview.html">
]]>
@@ -117,4 +117,4 @@ - \ No newline at end of file + diff --git a/spring-faces/.classpath b/spring-faces/.classpath index ddaee984..5967530f 100644 --- a/spring-faces/.classpath +++ b/spring-faces/.classpath @@ -8,8 +8,8 @@ - - + + @@ -23,13 +23,13 @@ - - - - - - - + + + + + + + diff --git a/spring-faces/ivy.xml b/spring-faces/ivy.xml index dcc4454c..2b093dd6 100644 --- a/spring-faces/ivy.xml +++ b/spring-faces/ivy.xml @@ -11,6 +11,7 @@ + @@ -31,22 +32,26 @@ - - - - - - - + + + + + + + + + + + - - + + @@ -70,7 +75,7 @@ - + diff --git a/spring-faces/pom.xml b/spring-faces/pom.xml index dbbde107..0eae74f5 100644 --- a/spring-faces/pom.xml +++ b/spring-faces/pom.xml @@ -108,13 +108,13 @@ com.sun.faces jsf-api - 2.0.3 + 2.1.7 provided com.sun.faces jsf-impl - 2.0.3 + 2.1.7 provided @@ -216,6 +216,6 @@ - 3.0.5.RELEASE + 3.1.1.RELEASE diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContextMessageDelegate.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContextMessageDelegate.java index 04a34f6a..5c90b05d 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContextMessageDelegate.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowFacesContextMessageDelegate.java @@ -61,6 +61,13 @@ public class FlowFacesContextMessageDelegate { this.context = context; } + /** + * Whether Web Flow's MessageContext contains any errors. + */ + public boolean hasErrorMessages() { + return context.getMessageContext().hasErrorMessages(); + } + /** * @see FlowFacesContext#addMessage(String, FacesMessage) */ diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowPartialViewContext.java b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowPartialViewContext.java index ba7f7f2a..bc0ff70e 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/FlowPartialViewContext.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/FlowPartialViewContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2011 the original author or authors. + * Copyright 2004-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ */ package org.springframework.faces.webflow; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -55,7 +56,7 @@ public class FlowPartialViewContext extends PartialViewContextWrapper { RequestContext requestContext = RequestContextHolder.getRequestContext(); String[] fragmentIds = (String[]) requestContext.getFlashScope().get(View.RENDER_FRAGMENTS_ATTRIBUTE); if (fragmentIds != null && fragmentIds.length > 0) { - return Arrays.asList(fragmentIds); + return new ArrayList(Arrays.asList(fragmentIds)); } } return getWrapped().getRenderIds(); diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/Jsf2FlowApplication.java b/spring-faces/src/main/java/org/springframework/faces/webflow/Jsf2FlowApplication.java index 0fd91129..12f5048c 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/Jsf2FlowApplication.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/Jsf2FlowApplication.java @@ -26,7 +26,11 @@ import javax.faces.application.Resource; import javax.faces.application.ResourceHandler; import javax.faces.component.UIComponent; import javax.faces.component.behavior.Behavior; +import javax.faces.component.visit.VisitContext; import javax.faces.context.FacesContext; +import javax.faces.event.AbortProcessingException; +import javax.faces.event.ExceptionQueuedEvent; +import javax.faces.event.ExceptionQueuedEventContext; import javax.faces.event.SystemEvent; import javax.faces.event.SystemEventListener; @@ -116,4 +120,17 @@ public class Jsf2FlowApplication extends FlowApplication { getDelegate().unsubscribeFromEvent(systemEventClass, listener); } + // Ideally this method should be in JsfView + // We keep it here to avoid ClassNotFoundExceptions for JSF 1.2 apps + + static void publishPostRestoreStateEvent() { + FacesContext facesContext = FlowFacesContext.getCurrentInstance(); + try { + facesContext.getViewRoot().visitTree(VisitContext.createVisitContext(facesContext), + new PostRestoreStateEventVisitCallback()); + } catch (AbortProcessingException e) { + facesContext.getApplication().publishEvent(facesContext, ExceptionQueuedEvent.class, + new ExceptionQueuedEventContext(facesContext, e, null, facesContext.getCurrentPhaseId())); + } + } } diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/Jsf2FlowFacesContext.java b/spring-faces/src/main/java/org/springframework/faces/webflow/Jsf2FlowFacesContext.java index eb456971..eee23d44 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/Jsf2FlowFacesContext.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/Jsf2FlowFacesContext.java @@ -112,7 +112,11 @@ public class Jsf2FlowFacesContext extends FlowFacesContext { } public boolean isValidationFailed() { - return getDelegate().isValidationFailed(); + if (getMessageDelegate().hasErrorMessages()) { + return true; + } else { + return getDelegate().isValidationFailed(); + } } public void setExceptionHandler(ExceptionHandler exceptionHandler) { @@ -127,6 +131,12 @@ public class Jsf2FlowFacesContext extends FlowFacesContext { getDelegate().validationFailed(); } + // --------------- JSF 2.1 Pass-through delegate methods ------------------// + + public boolean isReleased() { + return getDelegate().isReleased(); + } + protected class Jsf2FlowExternalContext extends FlowExternalContext { Log logger = LogFactory.getLog(FlowExternalContext.class); @@ -242,5 +252,18 @@ public class Jsf2FlowFacesContext extends FlowFacesContext { return delegate.encodePartialActionURL(url); } + // --------------- JSF 2.1 Pass-through delegate methods ------------------// + + public int getSessionMaxInactiveInterval() { + return delegate.getSessionMaxInactiveInterval(); + } + + public boolean isSecure() { + return delegate.isSecure(); + } + + public void setSessionMaxInactiveInterval(int interval) { + delegate.setSessionMaxInactiveInterval(interval); + } } } diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfAjaxHandler.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfAjaxHandler.java index b9934c07..1678b0d3 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfAjaxHandler.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfAjaxHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2010 the original author or authors. + * Copyright 2004-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,8 +50,14 @@ public class JsfAjaxHandler extends AbstractAjaxHandler { } protected boolean isAjaxRequestInternal(HttpServletRequest request, HttpServletResponse response) { - String facesRequestHeader = request.getHeader("Faces-Request"); - return ("partial/ajax".equals(facesRequestHeader)) ? true : false; + FacesContext facesContext = FlowFacesContext.getCurrentInstance(); + if (facesContext != null) { + return facesContext.getPartialViewContext().isAjaxRequest(); + } else { + String header = request.getHeader("Faces-Request"); + String param = request.getParameter("javax.faces.partial.ajax"); + return ("partial/ajax".equals(header) || "true".equals(param)) ? true : false; + } } protected void sendAjaxRedirectInternal(final String targetUrl, final HttpServletRequest request, diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfUtils.java b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfUtils.java index 94bff65e..14a87676 100644 --- a/spring-faces/src/main/java/org/springframework/faces/webflow/JsfUtils.java +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/JsfUtils.java @@ -15,12 +15,15 @@ */ package org.springframework.faces.webflow; +import java.lang.reflect.Method; + import javax.faces.context.FacesContext; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import javax.faces.event.PhaseListener; import javax.faces.lifecycle.Lifecycle; +import org.springframework.util.ReflectionUtils; import org.springframework.webflow.execution.RequestContextHolder; /** @@ -66,4 +69,18 @@ public class JsfUtils { } } + // This method is here for JSF 1.2 backwards compatibility + + static void publishPostRestoreStateEvent() { + try { + Class clazz = Class.forName("org.springframework.faces.webflow.Jsf2FlowApplication"); + Method method = ReflectionUtils.findMethod(clazz, "publishPostRestoreStateEvent"); + ReflectionUtils.makeAccessible(method); + ReflectionUtils.invokeMethod(method, null); + + } catch (ClassNotFoundException ex) { + throw new IllegalStateException("Expected Jsf2FlowApplication: " + ex); + } + } + } 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 d270b2c0..4ff32a98 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 @@ -16,7 +16,6 @@ package org.springframework.faces.webflow; import static org.springframework.faces.webflow.JsfRuntimeInformation.isAtLeastJsf12; -import static org.springframework.faces.webflow.JsfRuntimeInformation.isLessThanJsf20; import java.io.IOException; import java.io.Serializable; @@ -137,17 +136,8 @@ public class JsfView implements View { } public Serializable getUserEventState() { - if (isLessThanJsf20()) { - // Set the temporary UIViewRoot state so that it will be available across the redirect - return new ViewRootHolder(getViewRoot()); - } else { - // In JSF 2 the partial state saving algorithm attaches a system event listener to the UIViewRoot which - // holds on to a reference to the FacesContext instance. The FacesContext instance is released at end of - // each request. Hence, keeping the UIViewRoot across the redirect is not feasible. - // @see com.sun.faces.context.StateContext$AddRemoveListener - logger.debug("User event state requested but not saved."); - return null; - } + // Set the temporary UIViewRoot state so that it will be available across the redirect + return new ViewRootHolder(getViewRoot()); } public boolean hasFlowEvent() { 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 a5186356..5cfa83c9 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 @@ -128,6 +128,9 @@ public class JsfViewFactory implements ViewFactory { view = createJsfView(viewRoot, lifecycle, context); } } + if (isAtLeastJsf20()) { + JsfUtils.publishPostRestoreStateEvent(); + } if (!facesContext.getRenderResponse()) { JsfUtils.notifyAfterListeners(PhaseId.RESTORE_VIEW, lifecycle, facesContext); } @@ -182,4 +185,5 @@ public class JsfViewFactory implements ViewFactory { processTree(context, child); } } + } diff --git a/spring-faces/src/main/java/org/springframework/faces/webflow/PostRestoreStateEventVisitCallback.java b/spring-faces/src/main/java/org/springframework/faces/webflow/PostRestoreStateEventVisitCallback.java new file mode 100644 index 00000000..8d4009ee --- /dev/null +++ b/spring-faces/src/main/java/org/springframework/faces/webflow/PostRestoreStateEventVisitCallback.java @@ -0,0 +1,28 @@ +package org.springframework.faces.webflow; + +import javax.faces.component.UIComponent; +import javax.faces.component.visit.VisitCallback; +import javax.faces.component.visit.VisitContext; +import javax.faces.component.visit.VisitResult; +import javax.faces.event.PostRestoreStateEvent; + +/** + * A VisitCallback used to deliver a PostRestoreStataEvent similar to + * {@code RestoreViewPhase.deliverPostRestoreStateEvent(..)} in Sun's JSF. + * + * @since 2.3.1 + */ +class PostRestoreStateEventVisitCallback implements VisitCallback { + + private PostRestoreStateEvent event; + + public VisitResult visit(VisitContext context, UIComponent target) { + if (this.event == null) { + this.event = new PostRestoreStateEvent(target); + } else { + this.event.setComponent(target); + } + target.processEvent(event); + return VisitResult.ACCEPT; + } +} diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java index ba4ced67..ea15bf0d 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowFacesContextTests.java @@ -27,15 +27,17 @@ public class FlowFacesContextTests extends TestCase { FacesContext facesContext; - RequestContext requestContext = (RequestContext) EasyMock.createMock(RequestContext.class); + RequestContext requestContext; MessageContext messageContext; MessageContext prepopulatedMessageContext; + @SuppressWarnings("cast") protected void setUp() throws Exception { jsf.setUp(); - facesContext = new FlowFacesContext(requestContext, jsf.facesContext()); + requestContext = (RequestContext) EasyMock.createMock(RequestContext.class); + facesContext = new Jsf2FlowFacesContext(requestContext, jsf.facesContext()); setupMessageContext(); } @@ -60,7 +62,6 @@ public class FlowFacesContextTests extends TestCase { assertEquals("foo", summaryMessage.getText()); Message detailMessage = messageContext.getMessagesBySource("foo_detail")[0]; assertEquals("bar", detailMessage.getText()); - } public final void testGetGlobalMessagesOnly() { @@ -262,6 +263,16 @@ public class FlowFacesContextTests extends TestCase { assertSame(facesContext, facesContext.getELContext().getContext(FacesContext.class)); } + public final void testValidationFailed() { + messageContext = new DefaultMessageContext(); + EasyMock.expect(requestContext.getMessageContext()).andStubReturn(messageContext); + EasyMock.replay(new Object[] { requestContext }); + + facesContext.addMessage("foo", new FacesMessage(FacesMessage.SEVERITY_ERROR, "foo", "bar")); + + assertEquals(true, facesContext.isValidationFailed()); + } + private void setupMessageContext() { prepopulatedMessageContext = new DefaultMessageContext(); prepopulatedMessageContext.addMessage(new MessageBuilder().source("null_summary").defaultText("foo").info() diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowPartialViewContextTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowPartialViewContextTests.java index a31185ff..e8102221 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/FlowPartialViewContextTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/FlowPartialViewContextTests.java @@ -16,6 +16,7 @@ import org.springframework.webflow.test.MockRequestContext; public class FlowPartialViewContextTests extends TestCase { + @SuppressWarnings("unchecked") public void testReturnFragmentIds() throws Exception { String[] fragmentIds = new String[] { "foo", "bar" }; @@ -46,4 +47,18 @@ public class FlowPartialViewContextTests extends TestCase { assertEquals(renderIds, context.getRenderIds()); } + @SuppressWarnings("unchecked") + public void testReturnFragmentIdsMutable() throws Exception { + String[] fragmentIds = new String[] { "foo", "bar" }; + + RequestContext requestContext = new MockRequestContext(); + requestContext.getFlashScope().asMap().put(View.RENDER_FRAGMENTS_ATTRIBUTE, fragmentIds); + RequestContextHolder.setRequestContext(requestContext); + + Collection renderIds = new FlowPartialViewContext(null).getRenderIds(); + renderIds.add("baz"); + + assertEquals(Arrays.asList("foo", "bar", "baz"), renderIds); + } + } \ No newline at end of file diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JSFMockHelper.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JSFMockHelper.java index c73b6d0b..e80a1741 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JSFMockHelper.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JSFMockHelper.java @@ -28,13 +28,14 @@ import org.apache.myfaces.test.mock.MockServletConfig; import org.apache.myfaces.test.mock.MockServletContext; import org.apache.myfaces.test.mock.lifecycle.MockLifecycle; import org.apache.myfaces.test.mock.lifecycle.MockLifecycleFactory; +import org.apache.myfaces.test.mock.visit.MockVisitContextFactory; /** * Helper for using the mock JSF environment provided by shale-test inside unit tests that do not extend * {@link AbstractJsfTestCase} * * @author Jeremy Grelle - * @author Phil Webb + * @author Phillip Webb */ public class JSFMockHelper { @@ -113,6 +114,11 @@ public class JSFMockHelper { public void setUp() throws Exception { + // Ensure no pre-existing FacesContext .. + if (FacesContext.getCurrentInstance() != null) { + FacesContext.getCurrentInstance().release(); + } + // Set up a new thread context class loader threadContextClassLoader = Thread.currentThread().getContextClassLoader(); Thread.currentThread().setContextClassLoader( @@ -132,8 +138,9 @@ public class JSFMockHelper { FactoryFinder.setFactory(FactoryFinder.FACES_CONTEXT_FACTORY, MockBaseFacesContextFactory.class.getName()); FactoryFinder.setFactory(FactoryFinder.LIFECYCLE_FACTORY, MockLifecycleFactory.class.getName()); FactoryFinder.setFactory(FactoryFinder.RENDER_KIT_FACTORY, MockRenderKitFactory.class.getName()); - FactoryFinder.setFactory(FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY, MockPartialViewContextFactory.class - .getName()); + FactoryFinder.setFactory(FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY, + MockPartialViewContextFactory.class.getName()); + FactoryFinder.setFactory(FactoryFinder.VISIT_CONTEXT_FACTORY, MockVisitContextFactory.class.getName()); lifecycleFactory = (MockLifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY); lifecycle = (MockLifecycle) lifecycleFactory.getLifecycle(LifecycleFactory.DEFAULT_LIFECYCLE); facesContextFactory = (FacesContextFactory) FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY); diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java index fb3c9b4e..1e8a4c36 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/JsfViewFactoryTests.java @@ -11,13 +11,20 @@ import javax.faces.component.UIOutput; import javax.faces.component.UIPanel; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; +import javax.faces.event.AbortProcessingException; +import javax.faces.event.ComponentSystemEvent; +import javax.faces.event.ExceptionQueuedEvent; +import javax.faces.event.ExceptionQueuedEventContext; import javax.faces.event.PhaseEvent; import javax.faces.event.PhaseId; import javax.faces.event.PhaseListener; +import javax.faces.event.PostRestoreStateEvent; +import javax.faces.event.SystemEvent; import javax.faces.lifecycle.Lifecycle; import junit.framework.TestCase; +import org.apache.myfaces.test.mock.MockApplication20; import org.easymock.EasyMock; import org.jboss.el.ExpressionFactoryImpl; import org.springframework.binding.expression.ExpressionParser; @@ -82,6 +89,8 @@ public class JsfViewFactoryTests extends TestCase { private void configureJsf() throws Exception { jsfMock.setUp(); + ExceptionEventAwareMockApplication application = new ExceptionEventAwareMockApplication(); + ((MockBaseFacesContext) FlowFacesContext.getCurrentInstance()).setApplication(application); trackingListener = new TrackingPhaseListener(); jsfMock.lifecycle().addPhaseListener(trackingListener); jsfMock.facesContext().setViewRoot(null); @@ -98,7 +107,7 @@ public class JsfViewFactoryTests extends TestCase { new FluentParserContext().template().evaluate(RequestContext.class).expectResult(String.class)), lifecycle); - UIViewRoot newRoot = new UIViewRoot(); + MockUIViewRoot newRoot = new MockUIViewRoot(); newRoot.setViewId(VIEW_ID); ((MockViewHandler) viewHandler).setCreateView(newRoot); context.inViewState(); @@ -115,7 +124,7 @@ public class JsfViewFactoryTests extends TestCase { } /** - * View already exists in view/flash scope and must be restored and the lifecycle executed, no event signaled + * View already exists in view/flash scope and must be restored and the lifecycle executed, no flow event signaled */ public final void testGetView_Restore() { @@ -124,7 +133,7 @@ public class JsfViewFactoryTests extends TestCase { new FluentParserContext().template().evaluate(RequestContext.class).expectResult(String.class)), lifecycle); - UIViewRoot existingRoot = new UIViewRoot(); + MockUIViewRoot existingRoot = new MockUIViewRoot(); existingRoot.setViewId(VIEW_ID); UIInput input = new UIInput(); input.setId("invalidInput"); @@ -144,10 +153,11 @@ public class JsfViewFactoryTests extends TestCase { assertEquals("View name did not match", VIEW_ID, ((JsfView) restoredView).getViewRoot().getViewId()); assertFalse("An unexpected event was signaled,", restoredView.hasFlowEvent()); assertTrue("The input component's valid flag was not reset", input.isValid()); + assertTrue("The PostRestoreViewEvent was not seen", existingRoot.isPostRestoreStateEventSeen()); } /** - * View already exists in view/flash scope and must be restored and the lifecycle executed, no event signaled + * View already exists in view/flash scope and must be restored and the lifecycle executed, no flow event signaled */ public final void testGetView_RestoreWithBindings() { @@ -156,7 +166,7 @@ public class JsfViewFactoryTests extends TestCase { new FluentParserContext().template().evaluate(RequestContext.class).expectResult(String.class)), lifecycle); - UIViewRoot existingRoot = new UIViewRoot(); + MockUIViewRoot existingRoot = new MockUIViewRoot(); existingRoot.setViewId(VIEW_ID); UIPanel panel = new UIPanel(); panel.setId("panel1"); @@ -190,11 +200,12 @@ public class JsfViewFactoryTests extends TestCase { assertFalse("An unexpected event was signaled,", restoredView.hasFlowEvent()); assertSame("The UIInput binding was not restored properly", input, testBean.getInput()); assertSame("The faceted UIOutput binding was not restored properly", output, testBean.getOutput()); + assertTrue("The PostRestoreViewEvent was not seen", existingRoot.isPostRestoreStateEventSeen()); } /** - * Ajax Request - View already exists in view/flash scope and must be restored and the lifecycle executed, no event - * signaled + * Ajax Request - View already exists in view/flash scope and must be restored and the lifecycle executed, no flow + * event signaled */ public final void testGetView_Restore_Ajax() { @@ -203,7 +214,7 @@ public class JsfViewFactoryTests extends TestCase { new FluentParserContext().template().evaluate(RequestContext.class).expectResult(String.class)), lifecycle); - UIViewRoot existingRoot = new UIViewRoot(); + MockUIViewRoot existingRoot = new MockUIViewRoot(); existingRoot.setViewId(VIEW_ID); ((MockViewHandler) viewHandler).setRestoreView(existingRoot); @@ -223,6 +234,7 @@ public class JsfViewFactoryTests extends TestCase { assertTrue("An ViewRoot was not set", ((JsfView) restoredView).getViewRoot() instanceof UIViewRoot); assertEquals("View name did not match", VIEW_ID, ((JsfView) restoredView).getViewRoot().getViewId()); assertFalse("An unexpected event was signaled,", restoredView.hasFlowEvent()); + assertTrue("The PostRestoreViewEvent was not seen", existingRoot.isPostRestoreStateEventSeen()); } /** @@ -234,7 +246,7 @@ public class JsfViewFactoryTests extends TestCase { new FluentParserContext().template().evaluate(RequestContext.class).expectResult(String.class)), lifecycle); - UIViewRoot newRoot = new UIViewRoot(); + MockUIViewRoot newRoot = new MockUIViewRoot(); newRoot.setViewId(VIEW_ID); jsfMock.facesContext().setViewRoot(newRoot); jsfMock.facesContext().renderResponse(); @@ -248,6 +260,30 @@ public class JsfViewFactoryTests extends TestCase { assertEquals("View name did not match", VIEW_ID, ((JsfView) newView).getViewRoot().getViewId()); assertSame("View root was not the third party instance", newRoot, ((JsfView) newView).getViewRoot()); assertFalse("An unexpected event was signaled,", newView.hasFlowEvent()); + assertTrue("The PostRestoreViewEvent was not seen", newRoot.isPostRestoreStateEventSeen()); + } + + public void testGetView_ExceptionsOnPostRestoreStateEvent() throws Exception { + lifecycle = new NoExecutionLifecycle(jsfMock.lifecycle()); + factory = new JsfViewFactory(parser.parseExpression(VIEW_ID, + new FluentParserContext().template().evaluate(RequestContext.class).expectResult(String.class)), + lifecycle); + + MockUIViewRoot existingRoot = new MockUIViewRoot(); + existingRoot.setThrowOnPostRestoreStateEvent(true); + existingRoot.setViewId(VIEW_ID); + ((MockViewHandler) viewHandler).setRestoreView(existingRoot); + + context.inViewState(); + EasyMock.expectLastCall().andReturn(Boolean.TRUE); + + EasyMock.replay(new Object[] { context }); + factory.getView(context); + ExceptionEventAwareMockApplication application = (ExceptionEventAwareMockApplication) FlowFacesContext + .getCurrentInstance().getApplication(); + assertNotNull("Expected exception event", application.getExceptionQueuedEventContext()); + assertSame("Expected same exception", existingRoot.getAbortProcessingException(), application + .getExceptionQueuedEventContext().getException()); } private class NoExecutionLifecycle extends FlowLifecycle { @@ -337,4 +373,51 @@ public class JsfViewFactoryTests extends TestCase { this.input = input; } } + + private static class MockUIViewRoot extends UIViewRoot { + + private boolean postRestoreStateEventSeen; + private boolean throwOnPostRestoreStateEvent; + private AbortProcessingException abortProcessingException; + + public void processEvent(ComponentSystemEvent event) throws AbortProcessingException { + if (event instanceof PostRestoreStateEvent) { + assertSame("Component did not match", this, ((PostRestoreStateEvent) event).getComponent()); + postRestoreStateEventSeen = true; + if (throwOnPostRestoreStateEvent) { + abortProcessingException = new AbortProcessingException(); + throw abortProcessingException; + } + } + } + + public void setThrowOnPostRestoreStateEvent(boolean throwOnPostRestoreStateEvent) { + this.throwOnPostRestoreStateEvent = throwOnPostRestoreStateEvent; + } + + public boolean isPostRestoreStateEventSeen() { + return postRestoreStateEventSeen; + } + + public AbortProcessingException getAbortProcessingException() { + return abortProcessingException; + } + } + + private static class ExceptionEventAwareMockApplication extends MockApplication20 { + + private ExceptionQueuedEventContext exceptionQueuedEventContext; + + public void publishEvent(FacesContext facesContext, Class systemEventClass, Object source) { + if (ExceptionQueuedEvent.class.equals(systemEventClass)) { + this.exceptionQueuedEventContext = (ExceptionQueuedEventContext) source; + } else { + super.publishEvent(facesContext, systemEventClass, source); + } + } + + public ExceptionQueuedEventContext getExceptionQueuedEventContext() { + return exceptionQueuedEventContext; + } + } } diff --git a/spring-faces/src/test/java/org/springframework/faces/webflow/MockBaseFacesContext.java b/spring-faces/src/test/java/org/springframework/faces/webflow/MockBaseFacesContext.java index 7b4fbe08..1a891a0b 100644 --- a/spring-faces/src/test/java/org/springframework/faces/webflow/MockBaseFacesContext.java +++ b/spring-faces/src/test/java/org/springframework/faces/webflow/MockBaseFacesContext.java @@ -38,4 +38,8 @@ public class MockBaseFacesContext extends MockFacesContext20 { } return application; } + + public void setApplication(Application application) { + this.application = application; + } } diff --git a/spring-faces/template.mf b/spring-faces/template.mf index 709dbdd2..1a6b17f2 100644 --- a/spring-faces/template.mf +++ b/spring-faces/template.mf @@ -8,7 +8,7 @@ Import-Template: org.springframework.binding.*;version="[2.4.0, 2.5.0)", org.springframework.js.*;version="[2.4.0, 2.5.0)", org.springframework.webflow.*;version="[2.4.0, 2.5.0)", - org.springframework.*;version="[3.0.5.RELEASE, 3.1.0)", + org.springframework.*;version="[3.1.0.RELEASE, 3.2.0)", org.apache.commons.logging;version="[1.1.1, 2.0.0)", javax.el;version="[1.0.0, 2.0.0)", javax.portlet;version="[2.0.0, 3.0.0)";resolution:=optional, diff --git a/spring-js-resources/.classpath b/spring-js-resources/.classpath index abba49bf..585b2fd2 100644 --- a/spring-js-resources/.classpath +++ b/spring-js-resources/.classpath @@ -14,14 +14,14 @@ - - - - - - - - + + + + + + + + diff --git a/spring-js/.classpath b/spring-js/.classpath index abba49bf..585b2fd2 100644 --- a/spring-js/.classpath +++ b/spring-js/.classpath @@ -14,14 +14,14 @@ - - - - - - - - + + + + + + + + diff --git a/spring-js/ivy.xml b/spring-js/ivy.xml index 9e026fdc..1fc2aba3 100644 --- a/spring-js/ivy.xml +++ b/spring-js/ivy.xml @@ -4,7 +4,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://incubator.apache.org/ivy/schemas/ivy.xsd" version="1.3"> - + @@ -26,21 +26,21 @@ - - - - - + + + + + - + - + diff --git a/spring-js/pom.xml b/spring-js/pom.xml index 24ec239d..5655730b 100644 --- a/spring-js/pom.xml +++ b/spring-js/pom.xml @@ -143,6 +143,6 @@ - 3.0.5.RELEASE + 3.1.1.RELEASE diff --git a/spring-js/template.mf b/spring-js/template.mf index 0f228cc8..9e696226 100644 --- a/spring-js/template.mf +++ b/spring-js/template.mf @@ -3,7 +3,7 @@ Bundle-Name: Spring JS Bundle-Vendor: SpringSource Bundle-ManifestVersion: 2 Import-Template: - org.springframework.*;version="[3.0.5.RELEASE, 3.1.0)", + org.springframework.*;version="[3.1.0.RELEASE, 3.2.0)", org.apache.commons.logging;version="[1.1.1, 2.0.0)", javax.servlet;version="[2.4.0, 3.0.0)", javax.servlet.http;version="[2.4.0, 3.0.0)", diff --git a/spring-webflow-reference/src/flow-definition-field-mappings.xml b/spring-webflow-reference/src/flow-definition-field-mappings.xml index e4083f33..3f907947 100644 --- a/spring-webflow-reference/src/flow-definition-field-mappings.xml +++ b/spring-webflow-reference/src/flow-definition-field-mappings.xml @@ -944,6 +944,22 @@ bind + + + * + + + validate + + + + + * + + + history + + diff --git a/spring-webflow-reference/src/overview.xml b/spring-webflow-reference/src/overview.xml index 0bbc7153..edad6d6f 100644 --- a/spring-webflow-reference/src/overview.xml +++ b/spring-webflow-reference/src/overview.xml @@ -48,166 +48,97 @@ How to access Web Flow artifacts from Maven Central - Each jar in the Web Flow distribution is available in the Maven Central Repository. + Each jar in the Web Flow distribution is available in the Maven Central Repository. This allows you to easily integrate Web Flow into your application if you are already using Maven as the build system for your web development project. - To access Web Flow jars from Maven Central, declare the following dependency in your pom (also adds "spring-binding", "spring-js", and "spring-js-resources"): + To access Web Flow jars from Maven Central, declare the following dependency in your pom (includes transitive dependencies "spring-binding" and "spring-js"): org.springframework.webflow spring-webflow - 2.4.0.RELEASE + x.y.z.RELEASE ]]> - If using JavaServer Faces, declare the following dependency in your pom (also adds the above dependencies): + If using JavaServer Faces, declare the following dependency in your pom (includes transitive dependencies "spring-binding", "spring-webflow" and "spring-js"): org.springframework.webflow spring-faces - 2.4.0.RELEASE + x.y.z.RELEASE ]]> - - - How to access Web Flow artifacts from the SpringSource Bundle Repository + + + How to access Web Flow artifacts with Ivy - Each jar in the Web Flow distribution is also available in the SpringSource Enterprise Bundle Repository. - Use this repository when you wish to run Spring Web Flow in an OSGi environment such as the SpringSource dm Server. - All jars obtained from the SpringSource Bundle Repository are OSGi-ready. + To access Spring Web Flow jars with Ivy, add the following repositories to your Ivy config: - - Accessing Web Flow bundles with Maven - - To access bundles using Maven, add the following repositories to your Maven pom: - - - com.springsource.repository.bundles.release - SpringSource Enterprise Bundle Repository - SpringSource Releases - http://repository.springsource.com/maven/bundles/release - - - - com.springsource.repository.bundles.external - SpringSource Enterprise Bundle Repository - External Releases - http://repository.springsource.com/maven/bundles/external -]]> - - - Then declare the following dependency: - - - org.springframework.webflow - org.springframework.webflow - 2.4.0.RELEASE -]]> - - - And if using JavaServer Faces: - - - org.springframework.webflow - org.springframework.faces - 2.4.0.RELEASE -]]> - - - Note the Web Flow artifacts in the SpringSource Bundle Repository are indexed under different ids because their transitive dependencies are different than the Maven Central artifacts. - The difference is the transitive jars such as commons-logging have been patched by SpringSource to add the metadata required to make them OSGi-compatible. - - - - Accessing Web Flow bundles with Ivy - - To access bundles using Ivy, add the following repositories to your Ivy config: - + [organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> + [organisation]/[module]/[revision]/[artifact]-[revision].[ext]" /> ]]> - - Then declare the following dependencies (also adds "org.springframework.binding", - "org.springframework.js", and "org.springframework.spring.js"): - + + To access Spring Web Flow jars as well as 3rd party dependencies with Ivy, add the following repository to your Ivy config: + + + +]]> + + + Then declare the following dependencies in your ivy.xml: + + runtime" /> + ]]> - - - And if using JavaServerFaces: - - runtime" />]]> + + + If using JavaServer Faces, declare the following dependency in your pom (also adds the above dependencies): + + runtime" />]]> - - - - Accessing the dm Server Web Flow library - - A dm Server library for Web Flow is also available if you are deploying to a dm Server environment. - Import this library in your MANIFEST.mf to automatically import all Web Flow bundles. - To access the library, add the following repository: - - - com.springsource.repository.libraries.release - SpringSource Enterprise Bundle Repository - SpringSource Library Releases - http://repository.springsource.com/maven/libraries/release -]]> - - - And declare the following dependency: - - - org.springframework.webflow - org.springframework.webflow-library - libd - 2.4.0.RELEASE -]]> - - + rev="x.y.z.RELEASE" conf="compile->runtime" />]]> + - How to access nightly builds + How to access nightly builds and milestone releases - Nightly snapshots of Web Flow development branches are available using Maven, and distribution zips are also available for download. + Nightly snapshots of Web Flow development branches are available using Maven. These snapshot builds are useful for testing out fixes you depend on in advance of the next release, and provide a convenient way for you to provide feedback about whether a fix meets your needs. - - If using Maven, you may obtain snapshots from either the SpringSource-managed Maven Central-compatible repository or the SpringSource Enterprise Bundle Repository. - Use the Maven Central-compatible snapshot repository when your project obtains its other open source dependencies from Maven Central. - Use the Spring Source Enterprise Bundle Snapshot Repository when you wish to run Web Flow in an OSGi environment. - - Accessing snapshots from the Maven-central compatible repository + Accessing snapshots and milestones with Maven - Add the following repository your pom: + For milestones and snapshots you'll need to use the SpringSource repository. + Add the following repository to your Maven pom.xml: - org.springsource.maven.snapshot - SpringSource Maven Central-compatible Snapshot Repository - http://maven.springframework.org/snapshot + springsource-repository + Spring project snapshots, milestones, and releases + http://repo.springsource.org/snapshot ]]> @@ -243,56 +174,5 @@ ]]> - - Accessing snapshots from the SpringSource Enterprise Bundle Repository - - Add the following repository your pom: - - - com.springsource.repository.bundles.snapshot - SpringSource Enterprise Bundle Snapshot Repository - http://repository.springsource.com/maven/bundles/snapshot -]]> - - - Then declare the following dependencies: - - - org.springframework.webflow - org.springframework.binding - x.y.z.BUILD-SNAPSHOT - - - - org.springframework.webflow - org.springframework.js - x.y.z.BUILD-SNAPSHOT - - - - org.springframework.webflow - org.springframework.webflow - x.y.z.BUILD-SNAPSHOT -]]> - - - And if using JavaServerFaces: - - - org.springframework.webflow - org.springframework.faces - x.y.z.BUILD-SNAPSHOT -]]> - - - - Accessing snapshot distribution archives - - Get the snapshot zip with the most recent CI build number from the Web Flow snapshot download area. - - diff --git a/spring-webflow-samples/booking-faces/.classpath b/spring-webflow-samples/booking-faces/.classpath index 7056877b..e0ebb6ee 100755 --- a/spring-webflow-samples/booking-faces/.classpath +++ b/spring-webflow-samples/booking-faces/.classpath @@ -9,87 +9,55 @@ - - - - - + - + - - - - - - - - - - - - - - - + + + - - - - - + - - - - - + - - - - - - - - - - + + - - + + - + - - - + + + - - - - + + + + - + - + - - - + + + - + \ No newline at end of file diff --git a/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component b/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component index b0f60e72..edc6f13a 100755 --- a/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component +++ b/spring-webflow-samples/booking-faces/.settings/org.eclipse.wst.common.component @@ -66,10 +66,10 @@ uses - + uses - + uses @@ -78,7 +78,7 @@ uses - + uses @@ -87,34 +87,34 @@ uses - + uses - + uses - + uses uses - + uses - + uses - + uses - + uses uses - + uses @@ -123,7 +123,7 @@ uses - + uses @@ -135,16 +135,16 @@ uses - + uses - + uses uses - + uses diff --git a/spring-webflow-samples/booking-faces/pom.xml b/spring-webflow-samples/booking-faces/pom.xml index 517ab5d1..7f7d0fc9 100644 --- a/spring-webflow-samples/booking-faces/pom.xml +++ b/spring-webflow-samples/booking-faces/pom.xml @@ -8,11 +8,11 @@ Hotel Booking : Spring MVC + Web Flow + JSF/PrimeFaces 2.4.0.BUILD-SNAPSHOT - 3.0.5.RELEASE + 3.1.1.RELEASE 3.0.2.RELEASE 1.5.10 - 2.0.3 - 2.2.1 + 2.1.7 + 3.1.1 @@ -185,37 +185,13 @@ - - org.maven.central - Maven Central Repository - http://repo1.maven.org/maven2 - false + spring-repository + Spring project snapshots, milestones, and releases + http://repo.springsource.org/snapshot - - org.springframework.maven.snapshot - Spring Maven Snapshot Repository - http://maven.springframework.org/snapshot - false - true - - - - org.springframework.maven.milestone - Spring Maven Milestone Repository - http://maven.springframework.org/milestone - false - - - - java.net.release - Repository for Projects On Hosted on java.net - http://download.java.net/maven/2 - - - - primefaces + primefaces-repository Prime Technology Maven Repository http://repository.primefaces.org default diff --git a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/HotelLazyDataModel.java b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/HotelLazyDataModel.java index 9e914e91..cdcb2cbf 100644 --- a/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/HotelLazyDataModel.java +++ b/spring-webflow-samples/booking-faces/src/main/java/org/springframework/webflow/samples/booking/HotelLazyDataModel.java @@ -7,6 +7,7 @@ import java.util.List; import java.util.Map; import org.primefaces.model.LazyDataModel; +import org.primefaces.model.SortOrder; public class HotelLazyDataModel extends LazyDataModel { @@ -24,9 +25,9 @@ public class HotelLazyDataModel extends LazyDataModel { } @Override - public List load(int first, int pageSize, String sortField, boolean sortOrder, Map filters) { + public List load(int first, int pageSize, String sortField, SortOrder sortOrder, Map filters) { searchCriteria.setCurrentPage(first / pageSize + 1); - return bookingService.findHotels(searchCriteria, first, sortField, sortOrder); + return bookingService.findHotels(searchCriteria, first, sortField, sortOrder.equals(SortOrder.ASCENDING)); } @Override @@ -42,4 +43,12 @@ public class HotelLazyDataModel extends LazyDataModel { this.selected = selected; } + public int getCurrentPage() { + return this.searchCriteria.getCurrentPage(); + } + + public int getPageSize() { + return this.searchCriteria.getPageSize(); + } + } \ No newline at end of file diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/data-access-config.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/data-access-config.xml index 34de9412..581e73bd 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/data-access-config.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/data-access-config.xml @@ -3,10 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/tx - http://www.springframework.org/schema/tx/spring-tx.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/security-config.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/security-config.xml index 22095f5a..ef58ed92 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/security-config.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/security-config.xml @@ -3,10 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/security - http://www.springframework.org/schema/security/spring-security.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/web-application-config.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/web-application-config.xml index 02cfdcde..942c9c19 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/web-application-config.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/web-application-config.xml @@ -3,10 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/context - http://www.springframework.org/schema/context/spring-context.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/webflow-config.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/webflow-config.xml index cf2c27d2..73b3f04a 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/webflow-config.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/webflow-config.xml @@ -4,9 +4,9 @@ xmlns:webflow="http://www.springframework.org/schema/webflow-config" xmlns:faces="http://www.springframework.org/schema/faces" xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config.xsd - http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd + http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.2.xsd"> diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/webmvc-config.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/webmvc-config.xml index 4d1ec049..571e501d 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/webmvc-config.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/config/webmvc-config.xml @@ -3,8 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:faces="http://www.springframework.org/schema/faces" xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces-2.2.xsd"> diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/booking-flow.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/booking-flow.xml index 16508198..5deff5b6 100755 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/booking-flow.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/booking-flow.xml @@ -1,7 +1,9 @@ + xsi:schemaLocation=" + http://www.springframework.org/schema/webflow + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml index 784d0dd0..fe286ec7 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/enterBookingDetails.xhtml @@ -3,7 +3,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.prime.com.tr/ui" + xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layouts/standard.xhtml">

diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml index bd22b15e..1f150988 100755 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/booking/reviewBooking.xhtml @@ -3,7 +3,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.prime.com.tr/ui" + xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layouts/standard.xhtml">

diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml index 346c3914..1d8e38b0 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/enterSearchCriteria.xhtml @@ -3,7 +3,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.prime.com.tr/ui" + xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layouts/standard.xhtml"> diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main-flow.xml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main-flow.xml index db77b19c..0ad4cc84 100755 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main-flow.xml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/main-flow.xml @@ -1,7 +1,9 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation=" + http://www.springframework.org/schema/webflow + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml index 363168c8..cbe13aa2 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotel.xhtml @@ -3,7 +3,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.prime.com.tr/ui" + xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layouts/standard.xhtml">

diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml index d9f63389..8a79fe30 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/flows/main/reviewHotels.xhtml @@ -3,7 +3,7 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" - xmlns:p="http://primefaces.prime.com.tr/ui" + xmlns:p="http://primefaces.org/ui" template="/WEB-INF/layouts/standard.xhtml">

@@ -18,8 +18,8 @@ - + Hotel Search Results
@@ -42,7 +42,7 @@ Action - + diff --git a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml index d17cbcff..bb14d6b4 100644 --- a/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml +++ b/spring-webflow-samples/booking-faces/src/main/webapp/WEB-INF/layouts/standard.xhtml @@ -4,7 +4,7 @@ xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ui="http://java.sun.com/jsf/facelets" - xmlns:p="http://primefaces.prime.com.tr/ui"> + xmlns:p="http://primefaces.org/ui"> diff --git a/spring-webflow-samples/booking-mvc/.classpath b/spring-webflow-samples/booking-mvc/.classpath index 3323c77e..c7a60d7c 100755 --- a/spring-webflow-samples/booking-mvc/.classpath +++ b/spring-webflow-samples/booking-mvc/.classpath @@ -11,120 +11,60 @@ - - - - - + - + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - + - - - - - + - - - - - + - - - - - - - - - - + + - - - + + + - - - - - + + + + + - + - - - + + + - - - - - - - - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/spring-webflow-samples/booking-mvc/.settings/org.eclipse.wst.common.component b/spring-webflow-samples/booking-mvc/.settings/org.eclipse.wst.common.component index 9af66bb5..2296c3e2 100755 --- a/spring-webflow-samples/booking-mvc/.settings/org.eclipse.wst.common.component +++ b/spring-webflow-samples/booking-mvc/.settings/org.eclipse.wst.common.component @@ -90,31 +90,31 @@ uses - + uses - + uses - + uses uses - + uses - + uses - + uses - + uses - + uses @@ -123,7 +123,7 @@ uses - + uses @@ -141,16 +141,16 @@ uses - + uses - + uses uses - + uses diff --git a/spring-webflow-samples/booking-mvc/pom.xml b/spring-webflow-samples/booking-mvc/pom.xml index fee152f4..064580e7 100644 --- a/spring-webflow-samples/booking-mvc/pom.xml +++ b/spring-webflow-samples/booking-mvc/pom.xml @@ -8,7 +8,7 @@ Hotel Booking : Spring MVC + Web Flow + JSP 2.4.0.BUILD-SNAPSHOT - 3.0.5.RELEASE + 3.1.1.RELEASE 3.0.2.RELEASE 1.5.10 @@ -208,28 +208,11 @@ - - org.maven.central - Maven Central Repository - http://repo1.maven.org/maven2/ - false + spring-repository + Spring project snapshots, milestones, and releases + http://repo.springsource.org/snapshot - - - org.springframework.maven.snapshot - Spring Maven Snapshot Repository - http://maven.springframework.org/snapshot - false - true - - - - org.springframework.maven.milestone - Spring Maven Milestone Repository - http://maven.springframework.org/milestone - false - booking-mvc diff --git a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/data-access-config.xml b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/data-access-config.xml index fd08d966..94e2bae0 100644 --- a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/data-access-config.xml +++ b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/data-access-config.xml @@ -3,10 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://www.springframework.org/schema/tx - http://www.springframework.org/schema/tx/spring-tx-2.5.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> diff --git a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/security-config.xml b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/security-config.xml index a7a11517..9a5df657 100644 --- a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/security-config.xml +++ b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/security-config.xml @@ -3,10 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://www.springframework.org/schema/security - http://www.springframework.org/schema/security/spring-security-3.0.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> diff --git a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/web-application-config.xml b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/web-application-config.xml index 3792545c..5791b170 100644 --- a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/web-application-config.xml +++ b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/web-application-config.xml @@ -3,10 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans-2.5.xsd - http://www.springframework.org/schema/context - http://www.springframework.org/schema/context/spring-context-2.5.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd"> diff --git a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/webflow-config.xml b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/webflow-config.xml index a8b343c8..7dcaeed3 100644 --- a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/webflow-config.xml +++ b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/webflow-config.xml @@ -3,10 +3,8 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:webflow="http://www.springframework.org/schema/webflow-config" xsi:schemaLocation=" - http://www.springframework.org/schema/beans - http://www.springframework.org/schema/beans/spring-beans.xsd - http://www.springframework.org/schema/webflow-config - http://www.springframework.org/schema/webflow-config/spring-webflow-config.xsd"> + http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd + http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd"> diff --git a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/webmvc-config.xml b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/webmvc-config.xml index e9cf7f66..56e56fd4 100644 --- a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/webmvc-config.xml +++ b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/config/webmvc-config.xml @@ -2,7 +2,8 @@ diff --git a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/booking-flow.xml b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/booking-flow.xml index 782efffb..ff62d702 100644 --- a/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/booking-flow.xml +++ b/spring-webflow-samples/booking-mvc/src/main/webapp/WEB-INF/hotels/booking/booking-flow.xml @@ -1,7 +1,9 @@ + xsi:schemaLocation=" + http://www.springframework.org/schema/webflow + http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd"> diff --git a/spring-webflow-samples/booking-portlet-faces/.classpath b/spring-webflow-samples/booking-portlet-faces/.classpath index 9778f4ce..3bfcf280 100644 --- a/spring-webflow-samples/booking-portlet-faces/.classpath +++ b/spring-webflow-samples/booking-portlet-faces/.classpath @@ -10,95 +10,55 @@ - - - - - + - - - - - - - - - - - - - - - - + + + + - - - - - + - - - - - + - - - - - + - - - - - - - - - - + + - - - - - + - - - + + + - - - - + + + + - + - - - - + + + + - - + + \ No newline at end of file diff --git a/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.wst.common.component b/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.wst.common.component index feccd726..61b4e00c 100644 --- a/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.wst.common.component +++ b/spring-webflow-samples/booking-portlet-faces/.settings/org.eclipse.wst.common.component @@ -93,34 +93,34 @@ uses - + uses - + uses - + uses uses - + uses - + uses - + uses - + uses uses - + uses @@ -129,22 +129,22 @@ uses - + uses - + uses - + uses uses - + uses - + uses diff --git a/spring-webflow-samples/booking-portlet-faces/pom.xml b/spring-webflow-samples/booking-portlet-faces/pom.xml index b18d73c6..4de6a49c 100644 --- a/spring-webflow-samples/booking-portlet-faces/pom.xml +++ b/spring-webflow-samples/booking-portlet-faces/pom.xml @@ -8,7 +8,7 @@ Hotel Booking : Spring Portlet MVC + Web Flow + JSF 2.4.0.BUILD-SNAPSHOT - 3.0.5.RELEASE + 3.1.1.RELEASE 1.5.10 1.2.9 @@ -170,28 +170,11 @@ - - org.maven.central - Maven Central Repository - http://repo1.maven.org/maven2 - false + spring-repository + Spring project snapshots, milestones, and releases + http://repo.springsource.org/snapshot - - - org.springframework.maven.snapshot - Spring Maven Snapshot Repository - http://maven.springframework.org/snapshot - false - true - - - - org.springframework.maven.milestone - Spring Maven Milestone Repository - http://maven.springframework.org/milestone - false - booking-portlet-faces diff --git a/spring-webflow-samples/booking-portlet-mvc/.classpath b/spring-webflow-samples/booking-portlet-mvc/.classpath index 6000c1ad..b7362231 100644 --- a/spring-webflow-samples/booking-portlet-mvc/.classpath +++ b/spring-webflow-samples/booking-portlet-mvc/.classpath @@ -11,84 +11,48 @@ - - - - - + - - - - - - - - - - - - - - - - + + + + - - - - - + - - - - - + - - - - - + - - - - - - - - - - + + - - - + + + - - - - - + + + + + - - - - + + + + - - + + \ No newline at end of file diff --git a/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.wst.common.component b/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.wst.common.component index c0d3d84e..472deb3d 100644 --- a/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.wst.common.component +++ b/spring-webflow-samples/booking-portlet-mvc/.settings/org.eclipse.wst.common.component @@ -78,31 +78,31 @@ uses - + uses - + uses - + uses uses - + uses - + uses - + uses - + uses - + uses @@ -111,22 +111,22 @@ uses - + uses - + uses - + uses uses - + uses - + uses diff --git a/spring-webflow-samples/booking-portlet-mvc/pom.xml b/spring-webflow-samples/booking-portlet-mvc/pom.xml index b22b34fb..201c10c0 100644 --- a/spring-webflow-samples/booking-portlet-mvc/pom.xml +++ b/spring-webflow-samples/booking-portlet-mvc/pom.xml @@ -8,7 +8,7 @@ Hotel Booking : Spring Portlet MVC + Web Flow + JSP 2.4.0.BUILD-SNAPSHOT - 3.0.5.RELEASE + 3.1.1.RELEASE 1.5.10 @@ -175,28 +175,11 @@ - - org.maven.central - Maven Central Repository - http://repo1.maven.org/maven2 - false + spring-repository + Spring project snapshots, milestones, and releases + http://repo.springsource.org/snapshot - - - org.springframework.maven.snapshot - Spring Maven Snapshot Repository - http://maven.springframework.org/snapshot - false - true - - - - org.springframework.maven.milestone - Spring Maven Milestone Repository - http://maven.springframework.org/milestone - false - booking-portlet-mvc diff --git a/spring-webflow-samples/jsf-booking/.classpath b/spring-webflow-samples/jsf-booking/.classpath index 65c3eeb3..877ae6bd 100644 --- a/spring-webflow-samples/jsf-booking/.classpath +++ b/spring-webflow-samples/jsf-booking/.classpath @@ -8,56 +8,36 @@ - - - - - - - - - - - + + + - - - - - + - - - - - + - - - - - + - - + + - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/spring-webflow-samples/jsf-booking/.settings/org.eclipse.wst.common.component b/spring-webflow-samples/jsf-booking/.settings/org.eclipse.wst.common.component index 0da81cfa..02fa66ee 100644 --- a/spring-webflow-samples/jsf-booking/.settings/org.eclipse.wst.common.component +++ b/spring-webflow-samples/jsf-booking/.settings/org.eclipse.wst.common.component @@ -45,10 +45,10 @@ uses - + uses - + uses @@ -63,34 +63,34 @@ uses - + uses - + uses - + uses - + uses - + uses - + uses - + uses - + uses - + uses - + uses diff --git a/spring-webflow-samples/jsf-booking/pom.xml b/spring-webflow-samples/jsf-booking/pom.xml index deeca6b4..5be401f9 100644 --- a/spring-webflow-samples/jsf-booking/pom.xml +++ b/spring-webflow-samples/jsf-booking/pom.xml @@ -8,9 +8,9 @@ Hotel Booking : Spring Framework + JSF 2.4.0.BUILD-SNAPSHOT - 3.0.5.RELEASE + 3.1.1.RELEASE 1.5.10 - 2.0.3 + 2.1.7 @@ -133,33 +133,10 @@ - - org.maven.central - Maven Central Repository - http://repo1.maven.org/maven2 - false - - - - org.springframework.maven.snapshot - Spring Maven Snapshot Repository - http://maven.springframework.org/snapshot - false - true - - - - org.springframework.maven.milestone - Spring Maven Milestone Repository - http://maven.springframework.org/milestone - false - - - - java.net.release - Repository for Projects On Hosted on java.net - http://download.java.net/maven/2 + spring-repository + Spring project snapshots, milestones, and releases + http://repo.springsource.org/snapshot diff --git a/spring-webflow/.classpath b/spring-webflow/.classpath index e6e3a229..462f3631 100644 --- a/spring-webflow/.classpath +++ b/spring-webflow/.classpath @@ -34,18 +34,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/spring-webflow/ivy.xml b/spring-webflow/ivy.xml index 56631af3..a2747d53 100644 --- a/spring-webflow/ivy.xml +++ b/spring-webflow/ivy.xml @@ -30,15 +30,15 @@ - - - - - - - - - + + + + + + + + + @@ -52,10 +52,10 @@ - - - - + + + + \ No newline at end of file diff --git a/spring-webflow/pom.xml b/spring-webflow/pom.xml index 991a64b3..9f1620f9 100644 --- a/spring-webflow/pom.xml +++ b/spring-webflow/pom.xml @@ -256,6 +256,6 @@ - 3.0.5.RELEASE + 3.1.1.RELEASE diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/FlowExecutionExceptionHandler.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/FlowExecutionExceptionHandler.java index 36e2493d..a9add62e 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/FlowExecutionExceptionHandler.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/FlowExecutionExceptionHandler.java @@ -15,7 +15,6 @@ */ package org.springframework.webflow.engine; -import org.springframework.webflow.engine.support.TransitionExecutingFlowExecutionExceptionHandler; import org.springframework.webflow.execution.FlowExecutionException; /** @@ -32,7 +31,7 @@ import org.springframework.webflow.execution.FlowExecutionException; * * Note: Because flow execution handlers are more difficult to implement correctly, consider catching exceptions in your * web flow action code and returning result events that drive standard transitions. Alternatively, consider use of the - * existing {@link TransitionExecutingFlowExecutionExceptionHandler} which illustrates the proper way to implement an + * existing {@code TransitionExecutingFlowExecutionExceptionHandler} which illustrates the proper way to implement an * exception handler. * * @author Keith Donald diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImpl.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImpl.java index 524a4185..161a1def 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImpl.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImpl.java @@ -214,9 +214,6 @@ public class FlowExecutionImpl implements FlowExecution, Externalizable { if (logger.isDebugEnabled()) { logger.debug("Starting in " + externalContext + " with input " + input); } - if (hasEmbeddedModeAttribute(input)) { - attributes.asMap().put("embeddedMode", Boolean.TRUE); - } MessageContext messageContext = createMessageContext(null); RequestControlContext requestContext = createRequestContext(externalContext, messageContext); RequestContextHolder.setRequestContext(requestContext); @@ -353,13 +350,16 @@ public class FlowExecutionImpl implements FlowExecution, Externalizable { void start(Flow flow, MutableAttributeMap input, RequestControlContext context) { listeners.fireSessionCreating(context, flow); - FlowSession session = activateSession(flow); + FlowSessionImpl session = activateSession(flow); if (session.isRoot()) { status = FlowExecutionStatus.ACTIVE; } if (input == null) { input = new LocalAttributeMap(); } + if (hasEmbeddedModeAttribute(input)) { + session.setEmbeddedMode(); + } StateManageableMessageContext messageContext = (StateManageableMessageContext) context.getMessageContext(); messageContext.setMessageSource(flow.getApplicationContext()); listeners.fireSessionStarting(context, session, input); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java index acc704c6..478388d7 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactory.java @@ -78,7 +78,7 @@ public class FlowExecutionImplFactory implements FlowExecutionFactory { logger.debug("Creating new execution of '" + flowDefinition.getId() + "'"); } FlowExecutionImpl execution = new FlowExecutionImpl((Flow) flowDefinition); - execution.setAttributes(new LocalAttributeMap(executionAttributes.asMap())); + execution.setAttributes(executionAttributes); execution.setListeners(executionListenerLoader.getListeners(execution.getDefinition())); execution.setKeyFactory(executionKeyFactory); return execution; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowSessionImpl.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowSessionImpl.java index c30fd1e0..85e70122 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowSessionImpl.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/FlowSessionImpl.java @@ -32,8 +32,8 @@ import org.springframework.webflow.execution.FlowSession; /** * Implementation of the FlowSession interfaced used internally by the FlowExecutionImpl. This class is - * closely coupled with FlowExecutionImpl and RequestControlContextImpl. The three - * classes work together to form a complete flow execution implementation. + * closely coupled with FlowExecutionImpl and RequestControlContextImpl. The three classes + * work together to form a complete flow execution implementation. * * @author Keith Donald * @author Erwin Vervaet @@ -42,6 +42,8 @@ class FlowSessionImpl implements FlowSession, Externalizable { private static final String VIEW_SCOPE_ATTRIBUTE = "viewScope"; + private static final String EMBEDDED_MODE_ATTRIBUTE = "embeddedMode"; + /** * The flow definition (a singleton). *

@@ -119,6 +121,10 @@ class FlowSessionImpl implements FlowSession, Externalizable { return (MutableAttributeMap) scope.get(VIEW_SCOPE_ATTRIBUTE); } + public boolean isEmbeddedMode() { + return (Boolean) scope.get(EMBEDDED_MODE_ATTRIBUTE, Boolean.FALSE); + } + public FlowSession getParent() { return parent; } @@ -224,6 +230,14 @@ class FlowSessionImpl implements FlowSession, Externalizable { this.stateId = stateId; } + /** + * Set a flow session attribute to indicate the current session should execute in embedded mode. + * @see FlowSession#isEmbeddedMode() + */ + void setEmbeddedMode() { + this.scope.put(EMBEDDED_MODE_ATTRIBUTE, true); + } + // internal helpers /** @@ -242,8 +256,8 @@ class FlowSessionImpl implements FlowSession, Externalizable { public String toString() { if (flow != null) { - return new ToStringCreator(this).append("flow", getFlowId()).append("state", getStateId()).append("scope", - scope).toString(); + return new ToStringCreator(this).append("flow", getFlowId()).append("state", getStateId()) + .append("scope", scope).toString(); } else { return "[Unhydrated session '" + flowId + "' in state '" + stateId + "']"; } diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java index 17f93595..5b4a515d 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/impl/RequestControlContextImpl.java @@ -255,8 +255,7 @@ class RequestControlContextImpl implements RequestControlContext { } public boolean getEmbeddedMode() { - Boolean embedded = flowExecution.getAttributes().getBoolean("embeddedMode"); - return (embedded != null) ? embedded.booleanValue() : false; + return flowExecution.getActiveSession().isEmbeddedMode(); } public String toString() { diff --git a/spring-webflow/src/main/java/org/springframework/webflow/execution/FlowSession.java b/spring-webflow/src/main/java/org/springframework/webflow/execution/FlowSession.java index 2ef8d3ef..021a6c2a 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/execution/FlowSession.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/execution/FlowSession.java @@ -23,9 +23,9 @@ import org.springframework.webflow.definition.StateDefinition; * A single, local instantiation of a {@link FlowDefinition flow definition} launched within an overall flow execution. *

* This object maintains all instance state including session status within exactly one governing FlowExecution, as well - * as the current flow state. This object also acts as the local "flow scope" data model. Data in - * {@link #getScope() flow scope} lives for the life of this object and is cleaned up automatically when this object is - * destroyed. Destruction happens when this session enters an end state. + * as the current flow state. This object also acts as the local "flow scope" data model. Data in {@link #getScope() + * flow scope} lives for the life of this object and is cleaned up automatically when this object is destroyed. + * Destruction happens when this session enters an end state. *

* Note that a flow session is in no way linked to an HTTP session. It just uses the familiar "session" naming * convention to denote a stateful object. @@ -62,6 +62,12 @@ public interface FlowSession { */ public MutableAttributeMap getViewScope() throws IllegalStateException; + /** + * Returns true if the flow session was started in embedded page mode. An embedded flow can make different + * assumptions with regards to whether redirect after post is necessary. + */ + public boolean isEmbeddedMode(); + /** * Returns the parent flow session in the current flow execution, or null if there is no parent flow * session. diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java index 6307466b..ae80603a 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/AbstractMvcView.java @@ -521,7 +521,7 @@ public abstract class AbstractMvcView implements View { * @param transition the matched transition * @return true if binding should occur, false if not */ - private boolean shouldValidate(Object model, TransitionDefinition transition) { + protected boolean shouldValidate(Object model, TransitionDefinition transition) { Boolean validateAttribute = getValidateAttribute(transition); if (validateAttribute != null) { return validateAttribute.booleanValue(); diff --git a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/BindingModel.java b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/BindingModel.java index 24f32991..dfea1d67 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/BindingModel.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/mvc/view/BindingModel.java @@ -111,7 +111,7 @@ public class BindingModel extends AbstractErrors implements BindingResult { } public List getGlobalErrors() { - return toErrors(messageContext.getMessagesByCriteria(ERRORS_NULL_SOURCE)); + return toErrors(messageContext.getMessagesByCriteria(ERRORS_WITHOUT_FIELD_SOURCE)); } public List getFieldErrors(String field) { @@ -209,6 +209,10 @@ public class BindingModel extends AbstractErrors implements BindingResult { throw new UnsupportedOperationException("Should not be called during view rendering"); } + public String[] resolveMessageCodes(String errorCode) { + throw new UnsupportedOperationException("Should not be called during view rendering"); + } + // internal helpers private Expression parseFieldExpression(String field, boolean useResultTypeHint) { @@ -318,15 +322,15 @@ public class BindingModel extends AbstractErrors implements BindingResult { } }; - private static final MessageCriteria ERRORS_NULL_SOURCE = new MessageCriteria() { + private static final MessageCriteria ERRORS_WITHOUT_FIELD_SOURCE = new MessageCriteria() { public boolean test(Message message) { - return message.getSource() == null && message.getSeverity() == Severity.ERROR; + return (!message.hasField() && message.getSeverity() == Severity.ERROR); } }; private static final MessageCriteria ERRORS_FIELD_SOURCE = new MessageCriteria() { public boolean test(Message message) { - return message.getSeverity() == Severity.ERROR && message.getSource() instanceof String; + return (message.hasField() && message.getSeverity() == Severity.ERROR); } }; diff --git a/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowSession.java b/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowSession.java index 7fd3ee9b..1b76134e 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowSession.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/test/MockFlowSession.java @@ -36,7 +36,9 @@ import org.springframework.webflow.execution.FlowSession; */ public class MockFlowSession implements FlowSession { - private static final String FLOW_VIEW_MAP_ATTRIBUTE = "flowViewMap"; + private static final String VIEW_MAP_ATTRIBUTE = "flowViewMap"; + + private static final String EMBEDDED_MODE_ATTRIBUTE = "embeddedMode"; private Flow definition; @@ -99,7 +101,11 @@ public class MockFlowSession implements FlowSession { throw new IllegalStateException("The current state '" + state.getId() + "' of this flow '" + definition.getId() + "' is not a view state - view scope not accessible"); } - return (MutableAttributeMap) scope.get(FLOW_VIEW_MAP_ATTRIBUTE); + return (MutableAttributeMap) scope.get(VIEW_MAP_ATTRIBUTE); + } + + public boolean isEmbeddedMode() { + return (Boolean) scope.get(EMBEDDED_MODE_ATTRIBUTE, Boolean.FALSE); } public FlowSession getParent() { @@ -163,13 +169,21 @@ public class MockFlowSession implements FlowSession { return state; } + /** + * Set a flow session attribute to indicate the current session should execute in embedded mode. + * @see FlowSession#isEmbeddedMode() + */ + void setEmbeddedMode() { + this.scope.put(EMBEDDED_MODE_ATTRIBUTE, true); + } + // internal helpers private void initViewScope() { - scope.put(FLOW_VIEW_MAP_ATTRIBUTE, new LocalAttributeMap()); + scope.put(VIEW_MAP_ATTRIBUTE, new LocalAttributeMap()); } private void destroyViewScope() { - scope.remove(FLOW_VIEW_MAP_ATTRIBUTE); + scope.remove(VIEW_MAP_ATTRIBUTE); } } \ No newline at end of file diff --git a/spring-webflow/src/main/java/org/springframework/webflow/test/MockRequestControlContext.java b/spring-webflow/src/main/java/org/springframework/webflow/test/MockRequestControlContext.java index ec0b959b..f65a0eb6 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/test/MockRequestControlContext.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/test/MockRequestControlContext.java @@ -138,11 +138,7 @@ public class MockRequestControlContext extends MockRequestContext implements Req } public boolean getEmbeddedMode() { - Boolean embedded = getMockFlowExecutionContext().getAttributes().getBoolean("embeddedMode"); - if (embedded != null) { - return embedded; - } - return false; + return getMockFlowExecutionContext().getMockActiveSession().isEmbeddedMode(); } // implementation specific accessors for testing @@ -157,8 +153,7 @@ public class MockRequestControlContext extends MockRequestContext implements Req .put("redirectInSameState", Boolean.valueOf(redirectInSameState)); } - public void setEmbeddedMode(boolean embedded) { - getMockFlowExecutionContext().getAttributeMap().put("embeddedMode", Boolean.valueOf(embedded)); + public void setEmbeddedMode() { + getMockFlowExecutionContext().getMockActiveSession().setEmbeddedMode(); } - } \ No newline at end of file diff --git a/spring-webflow/src/main/java/overview.html b/spring-webflow/src/main/java/overview.html index 4bc7241f..84d0c175 100644 --- a/spring-webflow/src/main/java/overview.html +++ b/spring-webflow/src/main/java/overview.html @@ -2,84 +2,27 @@


-The public Java Documentation for Spring Web Flow, a framework for modeling and executing user interface flow. +The public Java Documentation for the Spring Web Flow project.

-

-Spring Web Flow's packages are partitioned across a set of logical layers. Higher layers depend on the layers directly beneath. Lower layers never depend on higher layers. -

-

-The layers of Spring Web Flow, from lowest to highest, are shown below: -

-

- -
-Layer architecture diagram -

-

-The description, subsystems, and source packages of each layer are summarized below: -

-

Execution Core Layer

-

-Contains the central public Spring Web Flow API elements. This includes elements to model flow definitions -as well as execute those flow definitions. As the "bottom layer", this layer defines key domain interfaces and is highly stable. -

-

Subsystems

-
    -
  1. {@link org.springframework.webflow.core Core} -
  2. {@link org.springframework.webflow.definition Flow Definition} -
  3. {@link org.springframework.webflow.definition.registry Flow Definition Registry} -
  4. {@link org.springframework.webflow.context External Context} -
  5. {@link org.springframework.webflow.conversation Conversation} -
  6. {@link org.springframework.webflow.execution Flow Execution} -
  7. {@link org.springframework.webflow.execution.repository Flow Execution Repository} -
  8. {@link org.springframework.webflow.action Action} -
  9. {@link org.springframework.webflow.util Util} -
-

Executor Layer

-

-Contains services called "flow executors" that drive the execution of flow definitions. This layer defines the -core FlowExecutor service interface and implementation, as well as adaption code for executing flows in several -specific environments. Support for Spring MVC, Struts, and Java Server Faces (JSF) environments is housed here. -This layer depends on the stable Execution Core, but is not coupled to the more volatile Execution Engine -implementation. -

-

Subsystems

-
    -
  1. {@link org.springframework.webflow.executor Core} -
  2. {@link org.springframework.webflow.executor.mvc Spring MVC} -
  3. {@link org.springframework.webflow.executor.struts Struts} -
  4. {@link org.springframework.webflow.executor.jsf Java Server Faces (JSF)} -
-

Execution Engine Layer

-

-Contains concrete implementations of the stable Execution Engine abstractions. This layer defines the -finite-state machine that carries out runtime flow execution. It also contains a builder subsystem for -assembling flows from externalized resources such as XML files. -

-

Subsystems

-
    -
  1. {@link org.springframework.webflow.engine Engine Implementation} -
  2. {@link org.springframework.webflow.engine.builder Flow Builder} -
-

Test Layer

-

-Contains support code for testing flow executions. Two types of support are provided: stubs for unit -testing engine artifacts, and base classes for writing flow execution integration tests. This layer -depends on the Execution Core and Execution Engine layers. -

-

Subsystems

-
    -
  1. {@link org.springframework.webflow.test Unit Test} -
  2. {@link org.springframework.webflow.test.execution Execution Test} -
-

System Configuration Layer

-

Subsystems

-

-Contains support for configuring the flow executor engine using Spring. A Spring 2.0 config schema is provided. -This is the top layer and depends on the Execution Core, Executor, and Execution Engine layers. -

-
    -
  1. {@link org.springframework.webflow.config Spring Configuration Support} -
+

Spring Web Flow facilitates building web applications that require guided navigation -- e.g. a shopping cart, flight check-in, a loan application, and many others. In contrast to stateless, free-form navigation such use cases have a clear start and end point, one or more screens to go through in a specific order, and a set of changes that are not finalized to the end.

+ +

A distinguishing feature is the ability to define a flow definition consisting of states, transitions, and data. For example, view states correspond to the individual screens of the flow while transitions are caused by events resulting from the click of a button or a link. Data may be stored in scopes such as flash, view, flow, and others. Scoped data is cleared when it is no longer in scope.

+ +

In REST terms a flow represents as a single resource. The same URL used to start the flow is also the URL used to step through the flow (there is also an execution key uniquely identifying the current flow instance). As a result of this approach navigation remains encapsulated in the flow definition.

+ +

Some key benefits of using Spring Web Flow:

+ +
    +
  • A flow abstraction to model "long conversations" in web applications
  • +
  • Proper encapsulation for navigation rules
  • +
  • Multiple scopes in which to keep data
  • +
  • Automatic use of the POST/REDIRECT/GET pattern to avoid browser warnings
  • +
  • Impossible to return to completed flow sessions via browser back button
  • +
  • Rapid prototyping of flow requirements
  • +
  • Development mode in which flow definition changes are detected on the fly
  • +
  • IDE visualization for flow definitions
  • +
  • Much more...
  • +
+ - \ No newline at end of file + 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 8e937b7c..23bcf30b 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 @@ -451,7 +451,7 @@ public class ViewStateTests extends TestCase { state.getTransitionSet().add(t); MockRequestControlContext context = new MockRequestControlContext(flow); context.getMockExternalContext().setAjaxRequest(true); - context.setEmbeddedMode(true); + context.setEmbeddedMode(); context.setAlwaysRedirectOnPause(true); context.setRedirectInSameState(true); state.enter(context); @@ -468,7 +468,7 @@ public class ViewStateTests extends TestCase { MockRequestControlContext context = new MockRequestControlContext(flow); state.enter(context); context.getMockExternalContext().setAjaxRequest(true); - context.setEmbeddedMode(true); + context.setEmbeddedMode(); context.setAlwaysRedirectOnPause(true); context.setRedirectInSameState(true); assertFalse(context.getMockExternalContext().getFlowExecutionRedirectRequested()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java b/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java index 88a4d711..23a5adc1 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/engine/impl/FlowExecutionImplFactoryTests.java @@ -85,7 +85,7 @@ public class FlowExecutionImplFactoryTests extends TestCase { factory.setExecutionAttributes(attributes); FlowExecution execution = factory.createFlowExecution(flowDefinition); assertEquals(attributes, execution.getAttributes()); - assertNotSame(attributes, execution.getAttributes()); + assertSame("Flow execution attributes are global", attributes.asMap(), execution.getAttributes().asMap()); } public void testCreateWithExecutionListener() { @@ -142,7 +142,8 @@ public class FlowExecutionImplFactoryTests extends TestCase { flowExecution.getFlowSessions().add(session1); flowExecution.getFlowSessions().add(session2); factory.restoreFlowExecution(flowExecution, flowDefinition, flowExecutionKey, conversationScope, locator); - assertSame(executionAttributes, flowExecution.getAttributes()); + assertSame("Flow execution attributes are global", flowExecution.getAttributes().asMap(), + executionAttributes.asMap()); assertEquals(1, flowExecution.getListeners().length); assertSame(listener, flowExecution.getListeners()[0]); assertSame(flowExecutionKey, flowExecution.getKey()); diff --git a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java index 877b641f..0623dac6 100644 --- a/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java +++ b/spring-webflow/src/test/java/org/springframework/webflow/mvc/view/AbstractBindingModelTests.java @@ -150,7 +150,8 @@ public abstract class AbstractBindingModelTests extends TestCase { model.pushNestedPath("nestedBean"); assertEquals("test", model.getFieldValue("datum1")); assertEquals("0", model.getFieldValue("datum2")); - assertEquals(int.class, model.getFieldType("datum2")); + Class clazz = model.getFieldType("datum2"); + assertTrue(int.class.equals(clazz) || Integer.class.equals(clazz)); messages.addMessage(new MessageBuilder().source("nestedBean.datum2").error().defaultText("Error").build()); assertNotNull(model.getFieldErrors("datum2").get(0)); diff --git a/spring-webflow/template.mf b/spring-webflow/template.mf index 6291d5a2..7b9a54b0 100644 --- a/spring-webflow/template.mf +++ b/spring-webflow/template.mf @@ -5,10 +5,10 @@ Bundle-ManifestVersion: 2 Import-Template: org.springframework.binding.*;version="[2.4.0, 2.5.0)", org.springframework.js.*;version="[2.4.0, 2.5.0)", - org.springframework.*;version="[3.0.5.RELEASE, 3.1.0)", - org.springframework.orm.*;version="[3.0.5.RELEASE, 3.1.0)";resolution:=optional, - org.springframework.transaction.*;version="[3.0.5.RELEASE, 3.1.0)";resolution:=optional, - org.springframework.web.portlet.*;version="[3.0.5.RELEASE, 3.1.0)";resolution:=optional, + org.springframework.*;version="[3.1.0.RELEASE, 3.2.0)", + org.springframework.orm.*;version="[3.1.0.RELEASE, 3.2.0)";resolution:=optional, + org.springframework.transaction.*;version="[3.1.0.RELEASE, 3.2.0)";resolution:=optional, + org.springframework.web.portlet.*;version="[3.1.0.RELEASE, 3.2.0)";resolution:=optional, org.springframework.security.*;version="[3.0.0, 4.0.0)";resolution:=optional, org.apache.commons.logging;version="[1.1.1, 2.0.0)", javax.servlet;version="[2.4.0, 3.0.0)",