大项目之网上书城(九)——订单Demo

目录

  • 大项目之网上书城(九)——订单Demo

    • 主要改动
    • 1.OrderServiceImpl
      • 代码
    • 2.OrderDaoImpl
      • 代码
    • 3.OrderitemDaoImpl
      • 代码
    • 4.orderitem_insert触发器
      • 代码
    • 5.DelOrderServlet
      • 代码
    • 6.NewOrderServlet
      • 代码
    • 7.PayForServlet
      • 代码
    • 8.shouhuo.jsp
      • 代码
      • 效果图
    • 9.order.jsp
      • 代码
      • 效果图
    • 总结

大项目之网上书城(九)——订单Demo

主要改动

加了创建订单,为订单付款,删除订单。

1.OrderServiceImpl

代码

有添加、删除、付款、根据是否付款查找。还加了添加收货信息登记。

package cn.edu.bdu.mc.services.impls;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import cn.edu.bdu.mc.beans.Book;
import cn.edu.bdu.mc.beans.Order;
import cn.edu.bdu.mc.beans.Orderitem;
import cn.edu.bdu.mc.daos.BookDao;
import cn.edu.bdu.mc.daos.OrderDao;
import cn.edu.bdu.mc.daos.OrderitemDao;
import cn.edu.bdu.mc.daos.impls.BookDaoImpl;
import cn.edu.bdu.mc.daos.impls.OrderDaoImpl;
import cn.edu.bdu.mc.daos.impls.OrderitemDaoImpl;
import cn.edu.bdu.mc.services.OrderService;

public class OrderServiceImpl implements OrderService {

    private OrderDao orderDao = new OrderDaoImpl();
    private OrderitemDao orderitemDao  = new OrderitemDaoImpl();
    private BookDao bookDao = new BookDaoImpl();

    @Override
    public boolean addOrder(String order_id, int user_id, String name, String address, String phone, String[] book_ids) throws SQLException {
        // TODO Auto-generated method stub
        List<Book>books = new ArrayList<Book>();
        for (String book_id : book_ids) {
            Book book = bookDao.findBookById(Integer.parseInt(book_id));
            books.add(book);
            //如果数量不够了就本次购买失败
            if(book.getCount()==0) {
                return false;
            }
        }
        Order order = new Order();
        order.setUser_id(user_id);
        order.setReciver_name(name);
        order.setReciver_phone(phone);
        order.setReciver_address(address);
        order.setOrder_id(order_id);
        orderDao.addOrder(order);
        for (Book book : books) {
            Orderitem orderitem = new Orderitem();
            orderitem.setBook_id(book.getBook_id());
            orderitem.setOrder_id(order_id);
            orderitem.setCount(1);
            orderitem.setPrice(book.getPrice());
            book.setCount(book.getCount()-1);
            bookDao.update(book);
            orderitemDao.addOrderitem(orderitem);
        }
        return true;
    }

    @Override
    public void AfterPay(String order_id) throws SQLException {
        Order order = orderDao.findOrderById(order_id);
        order.setPaystate(1);
        orderDao.update(order);
    }

    @Override
    public Order delById(String order_id) throws SQLException {
        // TODO Auto-generated method stub
        Order order = orderDao.delById(order_id);
        orderitemDao.delById(order_id);
        return order;
    }

    @Override
    public List<Order> findNotPayByUser_id(int user_id) throws SQLException {
        // TODO Auto-generated method stub
        return orderDao.findOrderByUser_id(user_id, 0);
    }

    @Override
    public List<Order> findAreadyPayByUser_id(int user_id) throws SQLException {
        // TODO Auto-generated method stub
        return orderDao.findOrderByUser_id(user_id, 1);
    }

}

2.OrderDaoImpl

代码

目前有添加、删除、根据order_id查找和根据user_id查找

package cn.edu.bdu.mc.daos.impls;

import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

import javax.sql.DataSource;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import cn.edu.bdu.mc.beans.Order;
import cn.edu.bdu.mc.daos.OrderDao;
import cn.edu.bdu.mc.utils.JDBCUtil;

public class OrderDaoImpl implements OrderDao {

    private DataSource dataSource = JDBCUtil.getDataSource();
    private QueryRunner queryRunner = new QueryRunner(dataSource);      

    @Override
    public void addOrder(Order order) throws SQLException {
        // TODO Auto-generated method stub
        String sql = "insert into `order`(user_id,order_id,reciver_name,reciver_phone,reciver_address,paystate,money,order_time) values(?,?,?,?,?,0,0,?)";
        Date date = new Date();
        SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
        String date1 = dateFormat.format(date);
        queryRunner.update(sql,order.getUser_id(),order.getOrder_id(),order.getReciver_name(),order.getReciver_phone(),order.getReciver_address(),date1);
    }

    @Override
    public void update(Order order) throws SQLException {
        // TODO Auto-generated method stub
        String sql = "update `order` set user_id = ?,reciver_name = ?,reciver_phone = ?,reciver_address = ?,paystate = ?,money = ?,order_time = ?";
        queryRunner.update(sql,order.getUser_id(),order.getReciver_name(),order.getReciver_phone(),order.getReciver_address(),order.getPaystate(),order.getMoney(),order.getOrder_time());
    }

    @Override
    public Order findOrderById(String order_id) throws SQLException {
        // TODO Auto-generated method stub
        String sql = "select * from `order` where order_id = ?";
        return queryRunner.query(sql, new BeanHandler<Order>(Order.class), order_id);
    }

    @Override
    public Order delById(String order_id) throws SQLException {
        Order order = findOrderById(order_id);
        String sql = "delete from `order` where order_id = ?";
        queryRunner.update(sql, order_id);
        return order;
    }

    @Override
    public List<Order> findOrderByUser_id(int user_id, int paystate) throws SQLException {
        // TODO Auto-generated method stub
        String sql = "select * from `order` where user_id = ? and paystate = ?";
        return queryRunner.query(sql, new BeanListHandler<Order>(Order.class), user_id, paystate);
    }

}

3.OrderitemDaoImpl

代码

目前有添加和删除

package cn.edu.bdu.mc.daos.impls;

import java.sql.SQLException;

import javax.sql.DataSource;

import org.apache.commons.dbutils.QueryRunner;

import cn.edu.bdu.mc.beans.Orderitem;
import cn.edu.bdu.mc.daos.OrderitemDao;
import cn.edu.bdu.mc.utils.JDBCUtil;

public class OrderitemDaoImpl implements OrderitemDao {

    private DataSource dataSource = JDBCUtil.getDataSource();
    private QueryRunner queryRunner = new QueryRunner(dataSource);      

    @Override
    public void addOrderitem(Orderitem orderitem) throws SQLException {
        // TODO Auto-generated method stub
        String sql = "insert into orderitem values (?,?,?,?)";
        queryRunner.update(sql,orderitem.getOrder_id(),orderitem.getBook_id(),orderitem.getCount(),orderitem.getPrice());
    }

    @Override
    public void delById(String order_id) throws SQLException {
        // TODO Auto-generated method stub
        String sql = "delete from `order` where order_id = ?";
        queryRunner.update(sql, order_id);
    }

}

4.orderitem_insert触发器

代码

orderitem中每增加一项,将他对应的order_id的订单的钱增加上他的书的价格乘以数量。

DROP TRIGGER IF EXISTS `orderitem_insert`;
DELIMITER ;;
CREATE TRIGGER `orderitem_insert` AFTER INSERT ON `orderitem` FOR EACH ROW begin
    update `order` set money = money + new.price * new.count where order_id = new.order_id;
end
;;
DELIMITER ;

5.DelOrderServlet

代码

package cn.edu.bdu.mc.servlets;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.edu.bdu.mc.beans.Order;
import cn.edu.bdu.mc.services.OrderService;
import cn.edu.bdu.mc.services.impls.OrderServiceImpl;

/**
 * Servlet implementation class DelOrderServlet
 */
@WebServlet("/DelOrder")
public class DelOrderServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
     * @see HttpServlet#HttpServlet()
     */
    public DelOrderServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        try {
            String order_id = request.getParameter("order_id");
            OrderService orderService = new OrderServiceImpl();
            Order order = orderService.delById(order_id);
            response.sendRedirect(request.getContextPath()+"/client/order.jsp");
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    /**
     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        doGet(request, response);
    }

}

6.NewOrderServlet

代码

package cn.edu.bdu.mc.servlets;

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import cn.edu.bdu.mc.beans.Order;
import cn.edu.bdu.mc.beans.User;
import cn.edu.bdu.mc.services.OrderService;
import cn.edu.bdu.mc.services.impls.OrderServiceImpl;

/**
 * Servlet implementation class NewOrderServlet
 */
@WebServlet("/NewOrder")
public class NewOrderServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
     * @see HttpServlet#HttpServlet()
     */
    public NewOrderServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        if(request.getSession().getAttribute("shouhuo")==null) {
            response.sendRedirect(request.getContextPath()+"/client/shouhuo.jsp");
        }else {
            try {
                String[] book_ids = request.getParameter("book_id_list").split("#");
                User user = (User) request.getSession().getAttribute("user");
                int user_id = user.getUser_id();
                Map<String, String>shouhuo = (Map<String, String>) request.getSession().getAttribute("shouhuo");
                String name = shouhuo.get("name");
                String phone = shouhuo.get("phone");
                String address = shouhuo.get("address");
                OrderService orderService = new OrderServiceImpl();
                String order_id = UUID.randomUUID().toString();
                boolean create_order = orderService.addOrder(order_id, user_id, name, address, phone, book_ids);
                if(create_order) {
                    String htmlCode="<!DOCTYPE html>\n" +
                            "<html>"
                            + "<head>"
                            + "<link rel=\"stylesheet\" href=\""+request.getContextPath()+"/bootstrap-3.3.7-dist/css/bootstrap.min.css\">"
                            + "</head>"
                            + "<body>"
                            + "<div style=\"position:absolute;left:44%;top:42%;height:140px;width:240px;background-color:rgba(145, 162, 196, 0.9);border:1px;text-align:center;\"id=\"quit1\">\r\n" +
                            "   <h3>订单创建成功!请尽快付款!</h3><a class=\"btn btn-info\" href=\""+request.getContextPath()+"/client/order.jsp\">查看订单</a>&nbsp;&nbsp;&nbsp;&nbsp;"
                            +"<a class=\"btn btn-info\" href=\""+request.getContextPath()+"/PayFor?order_id=\""+order_id+">立即付款</a>\n" +
                            "</div>"
                            + "</body>"
                            + "</html>";
                    response.getWriter().write(htmlCode);
                }else {
                    String htmlCode="<!DOCTYPE html>\n" +
                            "<html>"
                            + "<head>"
                            + "<link rel=\"stylesheet\" href=\""+request.getContextPath()+"/bootstrap-3.3.7-dist/css/bootstrap.min.css\">"
                            + "</head>"
                            + "<body>"
                            + "<div style=\"position:absolute;left:44%;top:46%;height:100px;width:240px;background-color:rgba(145, 162, 196, 0.9);border:1px;text-align:center;\"id=\"quit1\">\r\n" +
                            "   <h3>订单创建失败!请检查订单!</h3><a class=\"btn btn-info\" href=\""+request.getContextPath()+"/client/order.jsp\">查看订单</a>&nbsp;&nbsp;&nbsp;&nbsp;"
                            +"<a class=\"btn btn-info\" href=\""+request.getContextPath()+"/client/index.jsp\">再逛逛</a>\n" +
                            "</div>"
                            + "</body>"
                            + "</html>";
                    response.getWriter().write(htmlCode);
                }
            } catch (SQLException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }

    /**
     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        doGet(request, response);
    }

}

7.PayForServlet

代码

package cn.edu.bdu.mc.servlets;

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import cn.edu.bdu.mc.beans.Order;
import cn.edu.bdu.mc.beans.User;
import cn.edu.bdu.mc.daos.OrderDao;
import cn.edu.bdu.mc.daos.impls.OrderDaoImpl;
import cn.edu.bdu.mc.services.OrderService;
import cn.edu.bdu.mc.services.impls.OrderServiceImpl;

/**
 * Servlet implementation class PayForServlet
 */
@WebServlet("/PayFor")
public class PayForServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
     * @see HttpServlet#HttpServlet()
     */
    public PayForServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        try {
            String order_id = request.getParameter("order_id");
            OrderService orderService = new OrderServiceImpl();
            orderService.AfterPay(order_id);
            String htmlCode="<!DOCTYPE html>\n" +
                    "<html>"
                    + "<head>"
                    + "<link rel=\"stylesheet\" href=\""+request.getContextPath()+"/bootstrap-3.3.7-dist/css/bootstrap.min.css\">"
                    + "</head>"
                    + "<body>"
                    + "<div style=\"position:absolute;left:44%;top:46%;height:100px;width:240px;background-color:rgba(145, 162, 196, 0.9);border:1px;text-align:center;\"id=\"quit1\">\r\n" +
                    "   <h3>购买成功!</h3><a class=\"btn btn-info\" href=\""+request.getContextPath()+"/client/index.jsp\">继续购买</a>&nbsp;&nbsp;&nbsp;&nbsp;"
                            +"<a class=\"btn btn-info\" href=\""+request.getContextPath()+"/client/order.jsp\">查看订单</a>\n" +
                    "</div>"
                    + "</body>"
                    + "</html>";
            response.getWriter().write(htmlCode);
        } catch (SQLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

    }

    /**
     * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        doGet(request, response);
    }

}

8.shouhuo.jsp

代码

<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<title>收货地址</title>
</head>
<body style="background-color:#bbb;width:1400px;margin:0 auto">
<!-- 调用头部页面 -->
<div style="width:100%;height:100px;float:left">
<jsp:include page="/client/head.jsp"></jsp:include>
</div>
<!-- 通用内容体大小 -->
<div style="width:70%;height:720px;float:left;margin-left:15%;">
    <!-- 好看的图 -->
    <div style="width:55%;height:100%;float:left;margin-top:10%;">
        <img alt="快递员" src="${pageContext.request.contextPath }/client/img/kuaidi.jpg" style="width:90%;">
    </div>
    <!-- 登录界面 -->
    <div style="width:45%;height:80%;float:left;margin-top:7%">
        <h1 style="color:#8b6914;text-align:center">收货信息</h1>
        <hr style="height:2px;border:none;border-top:5px ridge green;" />
        <form action="${pageContext.request.contextPath }/ShouHuo" method="post" class="form-horizontal" role="form">
            <div class="form-group">
                <label for="lastname" class="col-sm-3 control-label input-lg">姓名</label>
                <div class="col-sm-9">
                    <input type="text" name="name" class="form-control input-lg"
                           placeholder="收货人姓名" style="float:left"/>
                </div>
            </div>
            <div class="form-group">
                <label for="firstname" class="col-sm-3 control-label input-lg">手机号</label>
                <div class="col-sm-9">
                    <input type="text" name="phone"
                    class="form-control input-lg" placeholder="收货人手机号" style="float:left"/>
                </div>
            </div>

            <div class="form-group">
                <label for="firstname" class="col-sm-3 control-label input-lg">地址</label>
                <div class="col-sm-9">
                    <input type="text" name="address"
                    class="form-control input-lg" placeholder="收货人地址" style="float:left"/>
                </div>
            </div>
            <div class="form-group">
                <label for="firstname" class="col-sm-1 control-label input-lg"></label>
                <div class="col-sm-5">
                    <input type="submit" name="submit" value="提交"
                    class="form-control input-lg btn btn-primary"style="width:100%;float:left"/>
                </div>
                <div class="col-sm-5">
                    <input type="reset" name="reset" value="重置" id="re"
                    class="form-control input-lg btn btn-warning"style="width:100%;float:left"/>
                </div>
            </div>
        </form>
    </div>
</div>
<!-- 调用底部页面 -->
<div style="width:100%;height:60px;float:left">
<jsp:include page="/client/foot.jsp"></jsp:include>
</div>
</body>
</html>

效果图

9.order.jsp

代码

<%@page import="cn.edu.bdu.mc.beans.User"%>
<%@page import="cn.edu.bdu.mc.services.impls.OrderServiceImpl"%>
<%@page import="cn.edu.bdu.mc.services.OrderService"%>
<%@page import="cn.edu.bdu.mc.beans.Order"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<title>订单</title>
</head>
<%
    User user = (User)request.getSession().getAttribute("user");
    OrderService orderService = new OrderServiceImpl();
    List<Order>notPay = orderService.findNotPayByUser_id(user.getUser_id());
    List<Order>areadyPay = orderService.findAreadyPayByUser_id(user.getUser_id());

%>
<body style="background-color:#bbb;width:1400px;margin:0 auto">
<!-- 调用头部页面 -->
<div style="width:100%;height:100px;float:left">
<jsp:include page="/client/head.jsp"></jsp:include>
</div>
<!-- 通用内容体大小 -->
<div style="width:70%;height:720px;float:left;margin-left:15%;">
    未付款:<br>
    <% if(notPay==null){ %>
        无<br>
    <% }else{ %>
        <% for(Order order : notPay){%>
            id=<font><%=order.getOrder_id() %></font>&nbsp;&nbsp;money=<font><%=order.getMoney() %></font>&nbsp;&nbsp;
            <a href="${pageContext.request.contextPath }/PayFor?order_id=<%=order.getOrder_id() %>">付款</a>&nbsp;&nbsp;
            <a href="${pageContext.request.contextPath }/DelOrder?order_id=<%=order.getOrder_id() %>">删除</a>&nbsp;&nbsp;
            <br>
        <% } %>
    <% } %>
    已付款:<br>
    <% if(areadyPay==null){ %>
        无<br>
    <% }else{ %>
        <% for(Order order : areadyPay){%>
            id=<font><%=order.getOrder_id() %></font>&nbsp;&nbsp;money=<font><%=order.getMoney() %></font>&nbsp;&nbsp;
            <br>
        <% } %>
    <% } %>
</div>
<!-- 调用底部页面 -->
<div style="width:100%;height:60px;float:left">
<jsp:include page="/client/foot.jsp"></jsp:include>
</div>
</body>
</html>

效果图

点击付款后,还删除了一个,忘截图了

总结

今天弄得不是很多,又是各种报错。再加上开始的晚,于是拖到了现在才更。

原文地址:https://www.cnblogs.com/zhangA/p/11071231.html

时间: 2024-11-09 22:29:14

大项目之网上书城(九)——订单Demo的相关文章

大项目之网上书城(六)——个人页面和书页面Demo

目录 大项目之网上书城(六)--个人页面和书页面Demo 主要改动 1.user.jsp 代码 效果图 user.js 代码 3.shu.jsp 代码 效果图 4.其他小改动 LoginServlet LogoutServlet BookService XinShuMingServlet 5.新增 FindPageByIdServlet ShuImgByIdServlet 总结 大项目之网上书城(六)--个人页面和书页面Demo 主要改动 今天时间依旧不是很多,,主要是今天思路不够丰富.勉强给个

大项目之网上书城(二)——主页(上)

目录 大项目之网上书城(二)--主页(上) 1.主页 代码 效果图 2.head2.jsp 代码 效果图 3.二级页面的empty.jsp 代码 效果图 总结 WebContent图 大项目之网上书城(二)--主页(上) 实在是太复杂啦,弄了半天才调出来一个壳子.明天再继续吧... 1.主页 代码 值得一提的是,我把所以的路径都改成用${pageContext}来获取的了,这样就可以方便我在不同的地方复制粘贴同样的代码,能有同样的功效了.(甚至字体的url都改了23333) <%@ page l

大项目之网上书城(十二)——完成啦

目录 大项目之网上书城(十二)--完成啦 主要改动 新增代码 1.addCategory.jsp 效果图 2.bookManager.jsp 效果图 3.userManager.jsp 效果图 4.error404.jsp 效果图 5.error500.jsp 效果图 6.errorelse.jsp 效果图 7.web.xml 8.addFenLeiServlet 9.bookDao里的addFenLei 总结 github页面 bookstoreZhang 大项目之网上书城(十二)--完成啦

项目2——网上书城项目

这个项目是帮舍友做的毕设项目,舍友是个作家,写小说的,想做一个管理小说的系统,我就帮代劳了,如果做出来他看不上再花钱找别人那就不该我事了哈哈,我尽力给做的好一点吧,舍友需求还是挺简单的 首先进行需求分析 前台 1.用户模块: 注册 激活 登录 退出 2.分类模块: 查看所有分类 3.图书模块 查询所有图书 按分类查询图书 查询图书详细(按id查询) 4.购物车模块: 添加购物车条目 清空所有条目 删除指定条目 我的购物车(按用户查询购物车) 5.订单模块 生成订单 我的订单(按用户查询订单) 按

网上书城项目

实习就要结束了,最终要上交的是网上书城项目和一份文档.接下来简要介绍一下项目. 项目是根据三层架构来写,数据访问层(DAO层).系统业务逻辑控制处理层(servlet层).和界面层(jsp). 首先在DAO层构造好SQL语句,对数据库进行操作,在servlet层调用Dao层相关方法进行相应的逻辑处理,JSP负责构造界面以及显示数据. 下面贴出代码,仅供参考,一些功能的具体实现在功能说明时有所介绍,只贴一些比较重要的部分的代码,大家主要重在理解. 此次项目,我感觉比较困难的部分是 加入购物车 部分

网上书城项目总结(servlet_jsp+javaBean)

网上书城项目总结 1 项目大纲设计: 需求分析 系统设计 详细设计 权限设计 2 技术选型: Servlet+jsp+javaBean Listener+Filter+jstl+fileupload+c3p0+dbutils+mysql 3 开发顺序: 从dao层到service层再到web层 网上书城需求分析: 分别对管理员,普通用户,系统三个用户角色的各个功能的实现. 其中包括管理员对图书商城的后台图书以及图书的类别分类增删查改,以及订单的状态; 普通用户对于图书的选购,浏览,购物车的管理以

网上书城+源码

经过一段时间的Java Web基础知识的学习,为了将整个知识点串联起来,自己写了一个简单的网上书城小项目.整个项目架构比较简单,适合像我这种Java Web初学者来学习参考,项目名称web_bookstore,是基于servlet/jsp和html/css/js实现的. 整个工程代码已push到Git,详见地址:web_bookstore. 整体架构 该网上书城项目分为前台和后台两大部分,前台部分包括会员注册.会员登录.购买书籍.添加购物车.结算等功能,后台部分包括查看会员.查看商品.添加商品等

2014年基于Raspberry Pi的5大项目

2014年基于Raspberry Pi的5大项目 Raspberry Pi(即树莓派)是一款基于Linux系统(Debian.ArchLinux)的单板机计算机,它只有一张信用卡大小,可用于电子表格制作.文字处理.游戏.高清视频播放等.它由英国的Raspberry Pi基金会开发,其目的是以低价硬件和自由软件刺激学校的基本的计算机科学教育.它搭载了ARM架构处理器,其运算性能和智能手机相仿.在接口方面,Raspberry Pi提供了USB接口.快速以太网接口.SD卡扩展接口以及HDMI高清视频输

用批处理来自动化项目编译及部署(附Demo)

阅读目录 介绍 详细 处理 结论 Demo下载 介绍 一个项目从立项开始,可能就已经根据公司的配置模板将目录,文档结构定义出来.有动态库,也有静态库,在没有专门的CMO的时候,往往组长,若干开发人员承担版本发布的工作.次工作即枯燥,又容易出错,那么怎么样才能将这样的工作略微自动化点.以下就通过很简单的很古老的批处理来略微自动化下. 详细 一:目录结构 每个公司的目录结构不一样,当略有相同,比如:管理库,需求库,设计库,代码库,引用库(包库),资源库,编译模板库,编译版本库,发布版本库等.如下图: