index.jsp
<%@ page language="java" import="java.util.*" pageEncoding="GB18030"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<a href="${ pageContext.request.contextPath}/start.do">开始</a>
</body>
</html>
step1.jsp
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
<h1>用户信息</h1>
<hr>
<form action="${ pageContext.request.contextPath}/step1.do" method="post">
姓名:<input type="text" name="name"><br>
<input type="submit" value="下一步">
</form>
</body>
</html>
step2.jsp
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
<h1>产品信息</h1>
<hr>
<form action="${ pageContext.request.contextPath}/step2.do" method="post">
<input type="checkbox" name="productId" value="1">产品1<br>
<input type="checkbox" name="productId" value="2">产品2<br>
<input type="checkbox" name="productId" value="3">产品3<br>
<input type="checkbox" name="productId" value="4">产品4<br>
<input type="checkbox" name="productId" value="5">产品5<br>
<input type="checkbox" name="productId" value="6">产品6<br>
<input type="submit" value="下一步">
</form>
</body>
</html>
step3.jsp
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
<h1>地址信息</h1>
<hr>
<form action="${ pageContext.request.contextPath}/step3.do" method="post">
地址:<input type="text" name="address"><br>
<input type="submit" value="下一步">
</form>
</body>
</html>
finish.jsp
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
<h1>订单信息</h1>
<hr>
<form action="${ pageContext.request.contextPath}/finish.do" method="post">
姓名:${stepForm.name }<br>
产品:
<c:forEach items="${stepForm.productId}" var="p" varStatus="vs">
产品${p }
<c:if test="${vs.count != fn:length(stepForm.productId)}">
,
</c:if>
</c:forEach>
<br>
地址:${stepForm.address }<br>
<input type="submit" value="确认">
</form>
</body>
</html>
success.jsp
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
成功!!
</body>
</html>