• 大小: 31.4MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-05
  • 语言: Java
  • 标签:

资源简介

多套jsp商城项目源码多套jsp商城项目源码多套jsp商城项目源码

资源截图

代码片段和文件信息

package bookstore;

import java.util.List;

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 org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;
import org.hibernate.Query;
import org.hibernate.Session;

import bookstore.database.Bookinfo;
import bookstore.database.HibernateUtil;

public class BookDetailAction extends Action {

    public ActionForward execute(ActionMapping mapping ActionForm srcForm
            HttpServletRequest request HttpServletResponse response)
            throws Exception {
        ActionMessages errors = new ActionMessages();
        // ��֤�Ƿ����˺Ϸ����鼮ID
        //如果id为空的话,报错。
        if (request.getParameter(“id“) == null
                || request.getParameter(“id“).equals(““)) {
            errors.add(“noid“ new ActionMessage(“bookdetail.noid“));
            this.saveErrors(request errors);
            return mapping.findForward(“errorPage“);
        }
        // ��ʼ��ѯ�鼮��Ϣ
        int id = Integer.parseInt(request.getParameter(“id“));
        Bookinfo book = loadBookInfo(id errors);
        if(book == null) {
            this.saveErrors(request errors);
            return mapping.findForward(“errorPage“);
        }
        request.setAttribute(“book“ book);
        return mapping.findForward(“bookdetail“);
    }

    private Bookinfo loadBookInfo(int id ActionMessages errors) {
        Session dbSession = HibernateUtil.currentSession();
        // ��ѯָ��ID���鼮
        try {
            HibernateUtil.beginTransaction();
            Query query = dbSession.createQuery(“ from Bookinfo as b where b.id=:id“)
                .setInteger(“id“ id)
                .setMaxResults(1);
            List result = query.list();
            HibernateUtil.commitTransaction();
            if(result.size() != 0) {
                return (Bookinfo) result.get(0);
            }
            errors.add(“noBook“ new ActionMessage(“bookdetail.noBook“));
        } catch(Exception e) {
            errors.add(“dbError“ new ActionMessage(“globle.dbError“));
        }
        return null;
    }

}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      10400  2007-06-20 20:47  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\Eatery_DB.sql

     文件       1816  2007-06-30 10:00  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\.classpath

     文件        453  2007-06-22 17:18  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\.myhibernatedata

     文件        282  2007-06-30 18:39  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\.mymetadata

     文件        256  2007-06-22 17:09  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\.mystrutsdata

     文件       1714  2007-06-23 14:34  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\.project

     文件        283  2007-06-22 17:03  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\.springBeans

     文件     286707  2007-06-22 17:03  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\lib\msbase.jar

     文件      67024  2007-06-22 17:03  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\lib\mssqlserver.jar

     文件      58903  2007-06-22 17:03  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\lib\msutil.jar

     文件       4733  2007-06-23 16:36  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\dao\ComplainInfoDAO.java

     文件       4513  2007-06-23 16:59  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\dao\CreditDAO.java

     文件       5790  2007-06-23 17:15  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\dao\EnterpriseInfoDAO.java

     文件       3946  2007-06-26 08:41  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\dao\FoodBigTypeDAO.java

     文件       5856  2007-06-23 17:57  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\dao\FoodInfoDAO.java

     文件       4528  2007-06-26 08:43  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\dao\FoodSmallTypeDAO.java

     文件       5560  2007-06-26 09:10  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\dao\ManageInfoDAO.java

     文件       4655  2007-06-26 09:36  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\dao\OrderAccessorilyDAO.java

     文件       5047  2007-06-26 09:33  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\dao\OrderInfoDAO.java

     文件       5830  2007-06-26 09:55  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\dao\UserInfoDAO.java

     文件        934  2007-06-22 17:06  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\po\ComplainInfo.hbm.xml

     文件       1086  2007-06-30 11:35  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\po\ComplainInfo.java

     文件        812  2007-06-22 17:07  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\po\Credit.hbm.xml

     文件       1187  2007-06-22 17:07  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\po\Credit.java

     文件       1924  2007-06-22 17:07  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\po\EnterpriseInfo.hbm.xml

     文件       3109  2007-06-22 17:07  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\po\EnterpriseInfo.java

     文件        924  2007-06-22 17:07  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\po\FoodBigType.hbm.xml

     文件       1400  2007-06-22 17:07  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\po\FoodBigType.java

     文件       1614  2007-06-22 17:07  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\po\FoodInfo.hbm.xml

     文件       2980  2007-06-23 17:41  网上订餐系统(struts+spring+hibernate)130221\三合一ssh\ssh\src\com\xaccp\po\FoodInfo.java

............此处省略1279个文件信息

评论

共有 条评论

相关资源