这个简单的购物车中怎么添加进去结算系统,新手,感觉毫无头绪,希望大神指点一下
main.jsp
<%@ page contentType="text/html;Charset=UTF-8" %>
<HTML>
<BODY bgcolor=yellow><FONT size=2>
<P>欢迎来到本页面,请输入您的姓名
<FORM action="" method=post name=form>
<Input type="text" name="name">
<Input type="submit" value="送出" name=submit>
</FORM>
<% String name=request.getParameter("name");
if(name==null){ name="";
}else{
 session.setAttribute("customerName",name);}%>
<%
 if(name.length()>0){
%> <P> 点击超链接,连接到food.jsp的页面,去采购食品。
<A href="food.jsp"> 
欢迎去食品柜台!
</A><% 
}%><FONT></BODY></HTML>
food.jsp
<%@ page contentType="text/html;Charset=UTF-8" %><HTML><BODY bgcolor=cyan><FONT size=3>
<P>点击超链接,连接到main.jsp的页面,去修改姓名。
<A href="main.jsp"> 欢迎去main.jsp!
</A><P>这里是食品柜台,请选择您要购买的食品:
<FORM action="" method=post name=form>
<Input type="checkbox" name="choice" value="香肠" >香肠
<Input type="checkbox" name="choice" value="苹果" >苹果
<Input type="checkbox" name="choice" value="酱油" >酱油
<Input type="checkbox" name="choice" value="饮料" >饮料</BR>
<Input type="submit" value="提交" name="submit">
</FORM></FONT>
<% String foodName[]=request.getParameterValues("choice");
if(foodName!=null){
 for(int k=0;k<foodName.length;k++){
 session.setAttribute(foodName[k],foodName[k]);
}}%>
<P>点击超链接,连接到count.jsp的页面,去查看购物车中的商品。
<A href="count.jsp"> 欢迎去count.jsp!
</A></BODY></HTML>
count.jsp
<%@ page contentType="text/html;Charset=UTF-8" %>
<%@ page import="java.util.*" %>
<HTML>
<P>这里是结帐处,您的姓名以及选择的商品:
<% String personName=(String)session.getAttribute("customerName");
out.println("<br>您的姓名:"+personName);
Enumeration enumGoods=session.getAttributeNames();
out.println("<br>购物车中的商品:<br>");
while(enumGoods.hasMoreElements()){ 
String key=(String)enumGoods.nextElement();
String goods=(String)session.getAttribute(key);if(!(goods.equals(personName)))out.println(goods+"<br>");
}%>
<P>点击超链接,连接到food.jsp的页面,购买食品。
<A href="food.jsp"> 欢迎去food.jsp!
</A><P>点击超链接,连接到main.jsp的页面,去修改姓名。
<A href="main.jsp"> 欢迎去main.jsp!
</A></FONT>
</BODY></HTML>