编程开发 > JAVA > 文章内容

java基础知识总结(164)

2016-9-26编辑:ljnbset

购物车

         (1)商品列表

                   step1 建表

                   create table t_computer(

                            id int primary key auto_increment,

                            model varchar(50),

                            pic varchar(50),

                            prodInfo varchar(255),

                            price double

                   );

                   insert into t_computer(model,pic,prodInfo,price)

                   values('x200','x200.jpg','good',1000);

                   insert into t_computer(model,pic,prodInfo,price)

                   values('x500','x500.jpg','very good',2000);

                   insert into t_computer(model,pic,prodInfo,price)

                   values('x600','x600.jpg','best',3000);

                   step2 建一个web工程 shoppingcart

                   step3 Computer实体类

                   step4 ComputerDAO

                                               List findAll()

                   step5 ActionServlet

                   step6  computer_list.jsp

         (2)购买商品

                            将用户购买的商品信息保存到session。

         (3)查看购物车中商品的信息

                            将session中保存的商品信息以表格的

                   方式显示出来

         (4)总价

                            将session中保存的商品的价格进行统计

         (5)修改商品数量

         (6)删除某件商品

         (7)清空所有购买的商品

java基础知识总结(163)

热点推荐

登录注册
触屏版电脑版网站地图