diff --git a/spring-webflow-reference/src/spring-mvc.xml b/spring-webflow-reference/src/spring-mvc.xml index 30c3a1ab..8d700047 100644 --- a/spring-webflow-reference/src/spring-mvc.xml +++ b/spring-webflow-reference/src/spring-mvc.xml @@ -271,20 +271,38 @@ public class BookingFlowHandler extends AbstractFlowHandler { Using a named HTML button to signal an event + + The example below shows two buttons on the same form that signal proceed and cancel events when clicked, respectively. + ]]> + + When a button is pressed Web Flow finds a request parameter name beginning with _eventId_ and treats the remaining substring as the event id. + So in this example, submitting _eventId_proceed becomes proceed. + This style should be considered when there are several different events that can be signaled from the same form. + Using a hidden HTML form parameter to signal an event + + The example below shows a form that signals the proceed event when submitted: + ]]> + + Here, Web Flow simply detects the special _eventId parameter and uses its value as the event id. + This style should only be considered when there is one event that can be signaled on the form. + Using a HTML link to signal an event + + The example below shows a link that signals the cancel event when activated: + Cancel]]> @@ -293,7 +311,7 @@ public class BookingFlowHandler extends AbstractFlowHandler { Firing an event results in a HTTP request being sent back to the server. On the server-side, the flow handles decoding the event from within its current view-state. How this decoding process works is specific to the view implementation. - A Spring MVC view implementation simply looks for a request parameter named _eventId. + Recall a Spring MVC view implementation simply looks for a request parameter named _eventId. If no _eventId parameter is found, the view will look for a parameter that starts with _eventId_ and will use the remaining substring as the event id. If neither cases exist, no flow event is triggered. 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 1b85e982..29a93044 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 @@ -35,7 +35,7 @@ - + diff --git a/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContext.java b/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContext.java index eafce00b..5a8a4f69 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContext.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/context/ExternalContext.java @@ -69,8 +69,8 @@ public interface ExternalContext { public SharedAttributeMap getSessionMap(); /** - * Provides access to the global external session map, providing a storage for data globally accross the - * user session and accessible to both internal and external SWF artifacts. + * Provides access to the global external session map, providing a storage for data globally accross the user + * session and accessible to both internal and external SWF artifacts. *

* Note: most external context implementations do not distinguish between the concept of a "local" user session * scope and a "global" session scope. The Portlet world does, but not the Servlet for example. In those cases @@ -93,8 +93,8 @@ public interface ExternalContext { public boolean isAjaxRequest(); /** - * Get a context-relative flow execution URL for the execution with the provided key. Typically used by response - * writers that write out references to the flow execution to support postback on a subsequent request. + * Get a flow execution URL for the execution with the provided key. Typically used by response writers that write + * out references to the flow execution to support postback on a subsequent request. * @param flowId the flow definition id * @param flowExecutionKey the flow execution key * @return the flow execution URL diff --git a/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContext.java b/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContext.java index 1af9d610..dcac5b09 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContext.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/execution/RequestContext.java @@ -32,8 +32,8 @@ import org.springframework.webflow.definition.TransitionDefinition; *

* A new instance of this object is typically created when one of the core operations supported by a flow execution is * invoked, either start to launch the flow execution, signalEvent to resume the flow - * execution, or refresh to reconstitute the flow execution's last view selection for purposes of - * reissuing a user response. + * execution, or refresh to reconstitute the flow execution's last view selection for purposes of reissuing + * a user response. *

* Once created this context object is passed around throughout flow execution request processing where it may be * accessed and reasoned upon by SWF-internal artifacts such as states, user-implemented action code, and state @@ -190,8 +190,8 @@ public interface RequestContext { public MutableAttributeMap getAttributes(); /** - * Returns the context-relative URL of this flow execution. Needed by response writers that write out the URL of - * this flow execution to allow calling back this execution in a subsequent request. + * Returns the URL of this flow execution. Needed by response writers that write out the URL of this flow execution + * to allow calling back this execution in a subsequent request. * @throws IllegalStateException if the flow execution has not yet had its key assigned * @return the flow execution URL */