-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 @@
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/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 @@
@@ -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
-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:
-
-
-The description, subsystems, and source packages of each layer are summarized below:
-
-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.
-
-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.
-
-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.
-
-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.
-
-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.
- 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:
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).
* 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.
-
-Layer architecture diagram
-Execution Core Layer
-Subsystems
-
-
-Executor Layer
-Subsystems
-
-
-Execution Engine Layer
-Subsystems
-
-
-Test Layer
-Subsystems
-
-
-System Configuration Layer
-Subsystems
-
-
+
+
+
-