JSP网络购物系统

  • Li1234567890
    了解作者
  • Java
    开发工具
  • 3MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 0
    下载次数
  • 2022-12-04 10:51
    上传日期
JSP源代码,需要自己建立数据库,自己修改!!!
JSP网络购物.rar
内容介绍
package com.webtier; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.ActionForward; import com.domain.GoodsForm; import org.apache.struts.action.Action; import com.dao.GoodsDao; import java.util.List; import com.dao.SmallTypeDao; import com.tool.Chinese; import javax.servlet.http.HttpSession; import java.io.UnsupportedEncodingException; //商品的Action public class GoodsAction extends Action { private int action; private GoodsDao dao = null; private SmallTypeDao small = null; private HttpSession session = null; public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws UnsupportedEncodingException { request.setCharacterEncoding("gb2312"); this.dao = new GoodsDao(); small = new SmallTypeDao(); action = Integer.parseInt(request.getParameter("action")); session = request.getSession(); switch (action) { case 0: { return goodSelect(mapping, form, request, response); //全部查询小类别信息 } case 1: { return goodForward(mapping, form, request, response); //转向页面 } case 2: { return selectSmallName(mapping, form, request, response); //查询小类别的名称 } case 3: { return saveGoods(mapping, form, request, response); //把从页面中信息存储在bean中 } case 4: { return insertGoods(mapping, form, request, response); //添加商品的信息 } case 5: { return selectOneGoods(mapping, form, request, response); //查看商品的详细信息 } case 6: { return deleteGoods(mapping, form, request, response); //删除商品信息 } case 7: { return goodSelectMark(mapping, form, request, response); // 按特价商品信息查询 } case 8: { return goodSelectSmall(mapping, form, request, response); //按小类别商品信息查询 } case 9: { return goodSelectBig(mapping, form, request, response); //按大类别商品信息查询 } case 10: { return managerFreePirceForward(mapping, form, request, response); //转向特价商品页面 } case 11: { return managerFreePirce(mapping, form, request, response); //设置特价价格 } case 12: { return goodSelectBigHead(mapping, form, request, response); //按大类别商品信息查询商品和商品小类别的名称 } case 13: { return goodSelectSmallHead(mapping, form, request, response); //按小类别商品信息查询商品和商品小类别的名称 } case 14: { return goodSelectNewHead(mapping, form, request, response); //新品查询 } case 15: { return goodSelectFreeHead(mapping, form, request, response); //特价商品 } case 16: { return goodSelectOneHead(mapping, form, request, response); //前台单独查询商品的信息 } } GoodsForm goodsForm = (GoodsForm) form; throw new java.lang.UnsupportedOperationException( "Method $execute() not yet implemented."); } // 前台单独查询商品的信息 public ActionForward goodSelectOneHead(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { request.setAttribute("form",dao.selectOneGoods(Integer.valueOf(request.getParameter("id")))); return mapping.findForward("goodSelectOneHead"); } //特价商品 public ActionForward goodSelectFreeHead(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { List list = null; String mark = request.getParameter("mark"); list = dao.selectMark(Integer.valueOf(mark)); int pageNumber = list.size(); //计算出有多少条记录 int maxPage = pageNumber; //计算有多少页数 String number = request.getParameter("i"); if (maxPage % 4 == 0) { maxPage = maxPage / 4; } else { maxPage = maxPage / 4 + 1; } if (number == null) { number = "0"; } request.setAttribute("number", String.valueOf(number)); request.setAttribute("maxPage", String.valueOf(maxPage)); request.setAttribute("pageNumber", String.valueOf(pageNumber)); request.setAttribute("list", list); return mapping.findForward("goodSelectFreeHead"); } //新品查询 public ActionForward goodSelectNewHead(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { List list = null; String mark = request.getParameter("mark"); list = dao.selectMark(Integer.valueOf(mark)); request.setAttribute("list", list); return mapping.findForward("goodSelectNewHead"); } //按小类别商品信息查询商品和商品小类别的名称 public ActionForward goodSelectSmallHead(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { List list = null; list = dao.selectSmall(Integer.valueOf(request.getParameter("small"))); int pageNumber = list.size(); //计算出有多少条记录 int maxPage = pageNumber; //计算有多少页数 String number = request.getParameter("i"); if (maxPage % 4 == 0) { maxPage = maxPage / 4; } else { maxPage = maxPage / 4 + 1; } if (number == null) { number = "0"; } request.setAttribute("number", String.valueOf(number)); request.setAttribute("maxPage", String.valueOf(maxPage)); request.setAttribute("pageNumber", String.valueOf(pageNumber)); request.setAttribute("list", list); request.setAttribute("smallList", small.selectOneBigId(Integer.valueOf(request. getParameter("big")))); return mapping.findForward("goodSelectSmallHead"); } //按大类别商品信息查询商品和商品小类别的名称 public ActionForward goodSelectBigHead(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { List list = null; list = dao.selectBig(Integer.valueOf(request.getParameter("big"))); int pageNumber = list.size(); //计算出有多少条记录 int maxPage = pageNumber; //计算有多少页数 String number = request.getParameter("i"); if (maxPage % 4 == 0) { maxPage = maxPage / 4; } else { maxPage = maxPage / 4 + 1; } if (number == null) { number = "0"; } request.setAttribute("number", String.valueOf(number)); request.setAttribute("maxPage", String.valueOf(maxPage)); request.setAttribute("pageNumber", String.valueOf(pageNumber)); request.setAttribute("list", list); request.setAttribute("smallList", small.selectOneBigId(Integer.valueOf(request. getParameter("big")))); return mapping.findForward("goodSelectBigHead"); } //设置特价价格 public ActionForward managerFreePirce(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { GoodsFor
评论
    相关推荐
    • jsp动态网页设计java+Tomcat+eclipse
      JSP动态网页设计,学生信息管理系统,数据库,课程设计
    • jsp动态网站——电子书店
      用Eclipse,tomcat,access开发,附有详细报告(67页)A4纸电子版,使用说明文件,下了就能用,无需修改。
    • JSP动态网页制作
      从零开始——JSP动态网页制作基础培训教程-源代码.rar
    • JSP动态网站项目.rar
      此项目是通过:eclipse软件开发的;里面没有数据库; 需要你们自已添加:是SQL数据库;
    • JSP动态网页新技术
      书是关于JSP网站编程的专著。作者从自学与教学的角度出发,从JSP的基础知识、基本语法入手,配以实际的范例细致讲解JSP网站编程的方法与技巧。 全书共有11章,第1章是JSP概述,并介绍JSP的运行环境和实现原理;第2章...
    • JSP动态网站开发教程
      JSP动态网页制作教程,想学习jsp的朋友们赶快下载吧、、
    • JSP动态网站开发
      掌握Servlet和会话技术 掌握基于组件的分层开发技术 掌握JSTL、EL和JavaBean 掌握JDBC的高级技术、自定义异常、JNDI查找数据源 掌握Web Services的创建、发布和调用
    • JSP动态网站实例源代码
      里面含有13个jsp动态网页实例源代码,放入相应的tomcat目录下即可运行,是学习jsp的好资源
    • jsp 动态网页制作 讲 义
      jsp 讲义,我个人觉得很不错。。。jsp 动态网页制作 讲 义
    • jsp动态网页制作(留言项目)
      不错的小项目,不需要下载积分,只要对大家有帮助就是对我的回报,,,嘻嘻!!!值得一看,,,希望大家有意见或者建议的就给我留言~~~~