Update demo to show saved output to flash scope

This demo shows how flow output can be mapped to MVC flash scope.  In
this case the output is a simple string message that will be displayed
to the user.

Issues: SWF-1561
This commit is contained in:
Phillip Webb
2012-07-23 09:21:34 -07:00
committed by Rossen Stoyanchev
parent 8d5ba1bbc2
commit f482b57108
4 changed files with 18 additions and 3 deletions

View File

@@ -40,9 +40,10 @@
<!-- Dispatches requests mapped to flows to FlowHandler implementations -->
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
<property name="flowExecutor" ref="flowExecutor"/>
<property name="saveOutputToFlashScopeOnRedirect" value="true"/>
</bean>
<!-- Custom FlowHandler for the hotel booking flow -->
<bean name="hotels/booking" class="org.springframework.webflow.samples.booking.BookingFlowHandler" />
</beans>
</beans>

View File

@@ -43,8 +43,10 @@
<transition on="cancel" to="cancel" />
</view-state>
<end-state id="bookingConfirmed"/>
<end-state id="bookingConfirmed">
<output name="confirmed" value="'Your booking is confirmed, you can book another hotel by searching again.'"/>
</end-state>
<end-state id="cancel" />
</flow>
</flow>

View File

@@ -1,5 +1,10 @@
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<tiles:insertAttribute name="searchForm" />
<c:if test="${not empty confirmed}">
<div class="confirmed">${confirmed}</div>
</c:if>
<tiles:insertAttribute name="bookingsTable" />

View File

@@ -51,3 +51,10 @@ button:hover {
font-weight: bold;
}
div.confirmed {
border: solid 1px #CCCCCC;
background: #E4F7CD;
padding: 4px;
font-weight: bold;
margin-bottom: 4px;
}