• 大小: 1.8MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-02
  • 语言: Java
  • 标签: 书店  

资源简介

JSP网上书店系统(源代码加论文)

资源截图

代码片段和文件信息


package BookStore;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import javax.servlet.ServletContext;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import java.sql.SQLException;

import java.util.*;
import javax.servlet.http.*;
import org.apache.struts.action.DynaActionForm;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

public final class AddrConfirmAction extends Action{  
public ActionForward execute(
ActionMapping mapping
ActionForm form
HttpServletRequest request  
HttpServletResponse response) throws Exception {

    DynaActionForm deliveryForm = (DynaActionForm) form;         
String delivery = (String)deliveryForm.get(“deliv“);
String payment = (String)deliveryForm.get(“payment“);

    ServletContext context = servlet.getServletContext();
DataSource dataSource = (DataSource)context.getAttribute(Constants.DATASOURCE_KEY);
        DB db = new DB(dataSource);
        
        HttpSession session = request.getSession();
    Vector shopCartList=(Vector)session.getAttribute(Constants.BOOK_SHOPCART_KEY);

String PageForward;
ActionMessages errors = new ActionMessages();
if (shopCartList==null||shopCartList.size()==0){
            errors.add(ActionMessages.GLOBAL_MESSAGE
                           new ActionMessage(“errors.nullShopCart“));
if (!errors.isEmpty()) {
saveErrors(request errors);

  PageForward=“toWrong“;  

}
else{
Order order = new Order();
order.setUsername ((String)session.getAttribute(Constants.LOGIN_USERNAME_KEY));
order.setDelivery(delivery);
order.setPayment(payment);
ShopCart shopCart = new ShopCart();

int orderId=order.Insert(db);
if (orderId==-1){
             errors.add(ActionMessages.GLOBAL_MESSAGE
                           new ActionMessage(“errors.insertFail“));
if (!errors.isEmpty()) {
saveErrors(request errors);

  PageForward=“toWrong“;  
}
else{
        order.setId(orderId);
session.setAttribute(Constants.BOOK_ORDER_KEYorder);
        if(shopCartList!=null){
        for(int i = 0; i < shopCartList.size() ;i++){
        shopCart = (ShopCart)shopCartList.get(i);
        shopCart.Save(dborderId);
        }
}
order.setTotal(order.GetOrderTotal(db));
Vector orderDetail=(Vector)shopCartList.clone();
session.setAttribute(Constants.ORDER_DETAIL_KEYorderDetail);
shopCartList.clear();
  PageForward=“toOrderConfirm“;  
}
    }
db.close();
    return (mapping.findForward(PageForward));
  }
 
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-24 10:22  jsp网上书店系统(源代码+论文)\
     目录           0  2013-12-20 23:08  jsp网上书店系统(源代码+论文)\bookstore\
     目录           0  2013-12-20 23:08  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\
     目录           0  2013-12-20 23:08  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\
     文件        2960  2013-12-20 11:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\AddrConfirmAction.java
     文件        4629  2013-12-20 14:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\Book.java
     文件        2626  2013-12-20 14:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookBuyAction.java
     文件        1136  2013-12-20 19:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookCat.java
     文件        1509  2013-12-20 16:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookDetailAction.java
     文件        2704  2013-12-20 16:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookSearchAction.java
     目录           0  2013-12-20 23:08  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\
     文件        2858  2013-12-20 13:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\AddrConfirmAction.class
     文件        3929  2013-12-20 17:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\Book.class
     文件        2702  2013-12-20 15:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\BookBuyAction.class
     文件        1352  2013-12-20 11:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\BookCat.class
     文件        1636  2013-12-20 12:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\BookDetailAction.class
     文件        2547  2013-12-20 17:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\BookSearchAction.class
     文件        1081  2013-12-20 13:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\ClearShopCartAction.class
     文件         995  2013-12-20 10:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\Constants.class
     文件        1632  2013-12-20 10:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\DB.class
     文件        1668  2013-12-20 13:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\DetailAction.class
     文件        2541  2013-12-20 16:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\LoginAction.class
     文件         708  2013-12-20 15:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\MyRequestProcessor.class
     文件        2817  2013-12-20 09:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\Order.class
     文件        2290  2013-12-20 12:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\OrderDelAction.class
     文件        1592  2013-12-20 19:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\OrderHistoryAction.class
     文件        2561  2013-12-20 11:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\PageCtrlAction.class
     文件        2191  2013-12-20 10:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\RegistAction.class
     文件        1351  2013-12-20 16:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\SearchStatus.class
     文件         951  2013-12-20 13:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\ShopCart.class
     文件        1646  2013-12-20 18:01  jsp网上书店系统(源代码+论文)\bookstore\WEB-INF\classes\BookStore\UpdateShopCartAction.class
............此处省略100个文件信息

评论

共有 条评论