This commit is contained in:
Keith Donald
2007-04-01 14:37:10 +00:00
parent 312f89cd9c
commit ccfbbcf7bf
7 changed files with 132 additions and 94 deletions

View File

@@ -1,7 +1,21 @@
<%@ include file="includeTop.jsp" %> <%@ page contentType="text/html" %>
<%@ page session="false" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
<title>Sell Item - Select Category</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div id="logo">
<img src="images/spring-logo.jpg" alt="Logo" border="0">
</div>
<f:view> <f:view>
<div id="content"> <div id="content">
<div id="insert"><img src="images/webflow-logo.jpg"/></div> <div id="insert"><img src="images/webflow-logo.jpg"/></div>
<h2>Select category</h2> <h2>Select category</h2>
@@ -39,7 +53,10 @@
</h:form> </h:form>
</table> </table>
</div> </div>
</f:view> </f:view>
<%@ include file="includeBottom.jsp" %> <div id="copyright">
<p>&copy; Copyright 2004-2007, <a href="http://www.springframework.org">www.springframework.org</a>, under the terms of the Apache 2.0 software license.</p>
</div>
</body>
</html>

View File

@@ -1,6 +1,18 @@
<%@ include file="includeTop.jsp" %> <%@ page contentType="text/html" %>
<%@ page session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<f:view> <html>
<head>
<title>Sell Item - Enter Shipping Information</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div id="logo">
<img src="images/spring-logo.jpg" alt="Logo" border="0">
</div>
<div id="content"> <div id="content">
<div id="insert"><img src="images/webflow-logo.jpg"/></div> <div id="insert"><img src="images/webflow-logo.jpg"/></div>
@@ -52,8 +64,10 @@
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
</f:view> <div id="copyright">
<p>&copy; Copyright 2004-2007, <a href="http://www.springframework.org">www.springframework.org</a>, under the terms of the Apache 2.0 software license.</p>
<%@ include file="includeBottom.jsp" %> </div>
</body>
</html>

View File

@@ -3,8 +3,6 @@
<head> <head>
</head> </head>
<body> <body>
<jsp:forward page="intro.jsf" /> <jsp:forward page="intro.jsf" />
</body> </body>
</html> </html>

View File

@@ -1,52 +1,35 @@
<%@ page session="true" %> <%-- make sure we have a session --%> <%-- make sure we have a session --%>
<%@ page session="true" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<HTML> <html>
<BODY> <body>
<f:view>
<DIV align="left">Sell Item - A Spring Web Flow Sample (JSF Version)</DIV>
<HR>
<DIV align="left">
<P>
<h:form>
<h:commandLink value="Sell Item" action="flowId:sellitem-flow"/>
</h:form>
</P>
<P>
This Spring web flow sample application implements the example application
discussed in the article
<A href="http://www-128.ibm.com/developerworks/java/library/j-contin.html">
Use continuations to develop complex Web applications</A>. It illustrates
the following concepts:
<UL>
<LI>
Spring Web Flow's JSF integration.
</LI>
<LI>
Using the flowId: command link prefix to let the view tell the web
flow controller which flow needs to be started.
</LI>
<LI>
Implementing a wizard using web flows.
</LI>
<LI>
Using <A href="http://www.ognl.org/">OGNL</A> based conditional expressions.
</LI>
</UL>
</P>
</DIV>
<HR>
<DIV align="right"></DIV> <f:view>
</BODY> <div align="left">
<p>
<h:form>
<h:commandLink value="Sell Item" action="flowId:sellitem-flow"/>
</h:form>
</p>
<p>
This Spring Web Flow sample application is the JSF-based version of the familiar "Sell item" sample.
It illustrates the following concepts:
</p>
<ul>
<li>Using Spring Web Flow with JSF</li>
<li>Implementing a wizard using web flows.</li>
<li>Using continuations to make the flow completely stable, no matter how browser navigation buttons are used.</li>
<li>
Using "conversation invalidation after completion" to prevent duplicate submits of the same sale
while taking advantage of continuations to allow back button usage while the application transaction is in process. </li>
<li>"Always redirect on pause" to benefit from the POST+REDIRECT+GET pattern with no special coding.</li>
<li>Using <A href="http://www.ognl.org/">OGNL</A> based conditional expressions.</li>
<li>Use of subflows to compose a multi-step business process from independently reusable modules.</li>
</ul>
</div>
</f:view> </f:view>
</HTML> </body>
</html>

View File

@@ -1,54 +1,61 @@
<%@ page contentType="text/html" %> <%@ page contentType="text/html" %>
<%@ include file="includeTop.jsp"%> <%@ page session="false" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
<title>Sell Item - Enter Price and Item Count</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div id="logo">
<img src="images/spring-logo.jpg" alt="Logo" border="0">
</div>
<f:view> <f:view>
<div id="content">
<div id="content">
<div id="insert"><img src="images/webflow-logo.jpg" /></div> <div id="insert"><img src="images/webflow-logo.jpg" /></div>
<!-- display any errors from sale Validator -->
<c:if test="${not empty sale}">
<spring:bind path="sale.*">
<c:forEach items="${status.errorMessages}" var="curError">
<div class="error">${curError}</div>
</c:forEach>
</spring:bind>
</c:if>
<h2>Enter price and item count</h2> <h2>Enter price and item count</h2>
<hr> <hr>
<table> <table>
<h:form id="priceAndItemCountForm"> <h:form id="priceAndItemCountForm">
<tr> <tr>
<td>Price:</td> <td>Price:</td>
<td><h:inputText id="price" value="#{flowScope.sale.price}" <td>
required="true"> <h:inputText id="price" value="#{flowScope.sale.price}" required="true">
<f:validateDoubleRange minimum="0.01"/> <f:validateDoubleRange minimum="0.01"/>
</h:inputText> </h:inputText>
&nbsp;&nbsp; &nbsp;&nbsp;
<h:message for="price" style="color: red"/> <h:message for="price" errorClass="error"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td>Item count:</td> <td>Item count:</td>
<td><h:inputText id="itemCount" value="#{flowScope.sale.itemCount}" <td>
required="true"> <h:inputText id="itemCount" value="#{flowScope.sale.itemCount}" required="true">
<f:validateLongRange minimum="1"/> <f:validateLongRange minimum="1"/>
</h:inputText> </h:inputText>
&nbsp;&nbsp; &nbsp;&nbsp;
<h:message for="itemCount" style="color: red"/> <h:message for="itemCount" errorClass="error"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" class="buttonBar"> <td colspan="2" class="buttonBar">
<input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}"/> <input type="hidden" name="_flowExecutionKey" value="${flowExecutionKey}"/>
<h:commandButton type="submit" value="Next" action="submit" immediate="false" /></td> <h:commandButton type="submit" value="Next" action="submit" immediate="false" />
</td>
</tr> </tr>
</h:form> </h:form>
</table> </table>
</div> </div>
</f:view> </f:view>
<%@ include file="includeBottom.jsp"%> <div id="copyright">
<p>&copy; Copyright 2004-2007, <a href="http://www.springframework.org">www.springframework.org</a>, under the terms of the Apache 2.0 software license.</p>
</div>
</body>
</html>

View File

@@ -1,8 +1,22 @@
<%@ include file="includeTop.jsp" %> <%@ page contentType="text/html" %>
<%@ page session="false" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<html>
<head>
<title>Sell Item - Enter Shipping Information</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body>
<div id="logo">
<img src="images/spring-logo.jpg" alt="Logo" border="0">
</div>
<f:view> <f:view>
<div id="content">
<div id="content">
<div id="insert"><img src="images/webflow-logo.jpg"/></div> <div id="insert"><img src="images/webflow-logo.jpg"/></div>
<h2>Enter shipping information</h2> <h2>Enter shipping information</h2>
<hr> <hr>
@@ -37,8 +51,11 @@
</tr> </tr>
</h:form> </h:form>
</table> </table>
</div> </div>
</f:view> </f:view>
<%@ include file="includeBottom.jsp" %> <div id="copyright">
<p>&copy; Copyright 2004-2007, <a href="http://www.springframework.org">www.springframework.org</a>, under the terms of the Apache 2.0 software license.</p>
</div>
</body>
</html>

View File

@@ -11,20 +11,22 @@
<p> <p>
This Spring Web Flow sample application implements the example application This Spring Web Flow sample application implements the example application
discussed in the article <a href="http://www-128.ibm.com/developerworks/java/library/j-contin.html"> discussed in the article <a href="http://www-128.ibm.com/developerworks/java/library/j-contin.html">
Use continuations to develop complex Web applications</a>. Use continuations to develop complex Web applications</a>. It illustrates the following concepts:
It illustrates the following concepts:
</p> </p>
<ul> <ul>
<li>Using the "_flowId" request parameter to let the view tell the web flow controller which flow needs to be started.</li> <li>Using the "_flowId" request parameter to let the view tell the web flow controller which flow needs to be started.</li>
<li>Implementing a wizard using web flows.</li> <li>Implementing a wizard using web flows.</li>
<li> <li>
Use of the FormAction to perform form processing, including the FormAction's "setupForm" method to install custom property editors for formatting text field values (shipDate). Use of the FormAction to perform form processing, including the FormAction's "setupForm" method to install custom
</li> property editors for formatting text field values (shipDate).
</li>
<li>Using continuations to make the flow completely stable, no matter how browser navigation buttons are used.</li> <li>Using continuations to make the flow completely stable, no matter how browser navigation buttons are used.</li>
<li> <li>
Using "conversation invalidation after completion" to prevent duplicate submits of the same sale Using "conversation invalidation after completion" to prevent duplicate submits of the same sale
while taking advantage of continuations to allow back button usage while the application transaction is in process. </li> while taking advantage of continuations to allow back button usage while the application transaction is in process.
<li>"Always redirect on pause" to benefit from the POST+REDIRECT+GET pattern with no special coding.</li> <li>Using <A href="http://www.ognl.org/">OGNL</A> based conditional expressions.</li> </li>
<li>"Always redirect on pause" to benefit from the POST+REDIRECT+GET pattern with no special coding.</li>
<li>Using <A href="http://www.ognl.org/">OGNL</A> based conditional expressions.</li>
<li>Use of subflows to compose a multi-step business process from independently reusable modules.</li> <li>Use of subflows to compose a multi-step business process from independently reusable modules.</li>
</ul> </ul>
</div> </div>