java购物车界⾯的代码,JavaBean购物车全代码学习JavaBean,根据书本写了简单的购物车页⾯,环境为MyEclipse 7.0+TOMCAT5.X,全部代码如下:
1.index.jsp登陆界⾯:
pageEncoding="GB2312"%>
String path = ContextPath();
String basePath =
%>
/p>
Transitional//EN">
href="">
购物车
content="no-cache">
content="no-cache">
content="0">
content="keyword1,keyword2,keyword3">
content="This is my page">
请输⼊⽤户名,默认的为Guest
mothod=get>
align="center">
color="FFFFFF">⽤户登陆
bgcolor="#CCCCCC">
⽤户名:
js购物车结算代码type="password"
name="userID">
bgcolor="#CCCCCC">
⼝ 令:
type="password"
name="password">
bgcolor="#CCCCCC">
type="submit"
value="登陆">
2.checklogin.jsp登陆认证页⾯:
pageEncoding="GB2312"%>
String path = ContextPath();
String basePath =
scope="session">
name="Car"/>
%>
/p>
Transitional//EN">
href="">
My JSP 'checklogin.jsp'
starting page
content="no-cache">
content="no-cache">
content="0">
content="keyword1,keyword2,keyword3">
content="This is my page">
String nextpage;
UserID().equals("Guest"))
nextpage="car.jsp";
else
nextpage="index.jsp";
%>
page="">
3.car.jsp购物车页⾯
pageEncoding="GB2312"%>
String path = ContextPath();
String basePath =
%>
/p>
Transitional//EN">
href="">
购物车
content="no-cache">
content="no-cache">
content="0">
content="keyword1,keyword2,keyword3"> content="This is my page">
file="header.jsp" %>
scope="session">
color="#804040" face="楷体_GB2312">
百货商场,请尽情的选购商品添加到购物车!
%>
value="没选择">
value="TV">电视机
value="apple">苹果
value="coke">可⼝可乐
value="milk">⽜奶
value="tea">茶叶
color="#804040" face="楷体_GB2312">
输⼊购买的数量:
name="mount">
value="个">个
value="公⽄">公⽄
value="台">台
value="瓶">瓶
value="提交添加">
color="#804040"
face="楷体_GB2312">你的购物车⾥有如下商品:Hashtable list=Car.list_h();
Enumeration enums=list.elements();
while(enums.hasMoreElements()){
String goods=(String) Element(); byte b[]=Bytes("ISO-8859-1"); goods=new String(b);
out.println("
"+goods);
}
%>
deRedirectURL("selectRemoveGoods.jsp");%>
value="修改购物车中的商品">
4.add.jsp 增加物品:
pageEncoding="UTF-8"%>
String path = ContextPath();
String basePath =
/p>
Transitional//EN">
href="">
购物车
content="no-cache">
content="no-cache">
content="0">
content="keyword1,keyword2,keyword3">
content="This is my page">
%>
scope="session">
property="*"/>
您的购物车有如下商品:
Hashtable list=Car.list_h();
Enumeration enums=list.elements();
while(enums.hasMoreElements()){
String goods=(String) Element();
byte b[]=Bytes("ISO-8859-1");
goods=new String(b);
out.println("
"+goods);
}
%>
%>
value="继续购物">
deRedirectURL("selectRemoveGoods.jsp");
%>
value="修改购物车中的物品">
5.selectRemoveGoods.jsp选择删除商品:
pageEncoding="UTF-8"%>
String path = ContextPath();
String basePath =
%>
/p>
Transitional//EN">
href="">
购物
content="no-cache">
content="no-cache">
content="0">
content="keyword1,keyword2,keyword3">
content="This is my page">
file="header.jsp" %>
scope="session">
选择从购物车中删除的物品:
deRedirectURL("removeWork.jsp");
%>
size="1">
value="TV">电视机
value="apple">苹果
value="coke">可⼝可乐
value="milk">⽜奶
value="tea">茶叶
value="提交删除">
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论