• 郎天
    了解作者
  • Java
    开发工具
  • 2.3MB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • 1 积分
    下载积分
  • 1
    下载次数
  • 2021-01-27 11:36
    上传日期
JSP 网上订餐系统,附带完整源码与数据库
网上订餐.rar
内容介绍
package com.sxdx.servlet; import java.io.IOException; import java.util.ArrayList; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.sxdx.dao.FoodInfoDAO; import com.sxdx.dao.FoodOrderInfoDAO; import com.sxdx.vo.FoodInfo; import com.sxdx.vo.FoodOrderInfo; public class FoodInfoServlet extends HttpServlet { /** * Constructor of the object. */ public FoodInfoServlet() { super(); } /** * Destruction of the servlet. <br> */ public void destroy() { super.destroy(); // Just puts "destroy" string in log // Put your code here } /** * The doGet method of the servlet. <br> * * This method is called when a form has its tag value method equals to get. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html;charset=utf-8"); request.setCharacterEncoding("utf-8"); FoodInfoDAO foodDAO = new FoodInfoDAO(); String op=request.getParameter("op"); if(op.equals("reg")) { String customerName=request.getParameter("customerName") ; String address=request.getParameter("address"); String zipCode=request.getParameter("zipCode"); String telephone=request.getParameter("telephone"); String movePhone=request.getParameter("movePhone"); String notice=request.getParameter("notice"); double totalPrice=Double.parseDouble(request.getParameter("totalPrice")); FoodOrderInfo foodOrderinfo=new FoodOrderInfo(customerName, address, zipCode, telephone, movePhone, notice, totalPrice); FoodOrderInfoDAO forDAO =new FoodOrderInfoDAO(); if(forDAO.regUserInfo(foodOrderinfo)) { request.getRequestDispatcher("/end.jsp").forward(request, response); }else { request.setAttribute("fail", "失败"); request.getRequestDispatcher("/end.jsp").forward(request, response); } } if(op.equals("details")) { String foodid=request.getParameter("foodid"); FoodInfo food= foodDAO.selectFoodById(foodid); request.setAttribute("food", food); request.getRequestDispatcher("/fooddetails.jsp").forward(request, response); } if(op.equals("login")) { ArrayList<FoodInfo> foodlist = foodDAO.selectAllFood(); request.setAttribute("foodlist", foodlist); request.getRequestDispatcher("/showfood.jsp").forward(request, response); } } /** * The doPost method of the servlet. <br> * * This method is called when a form has its tag value method equals to post. * * @param request the request send by the client to the server * @param response the response send by the server to the client * @throws ServletException if an error occurred * @throws IOException if an error occurred */ public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request,response); } /** * Initialization of the servlet. <br> * * @throws ServletException if an error occurs */ public void init() throws ServletException { // Put your code here } }
评论
    相关推荐
    • 网上订餐系统.zip
      完整的网上订餐系统,包括前端与SQL后台,可商业化
    • jsp+SQL网上订餐系统
      jsp+SQL网上订餐系统,该系统包括以下几个模块 1)系统登录 2)用户管理 3)基本信息 4)业务管理 5)业务查询
    • jsp网上订餐
      jsp网上订餐系统,代码+数据库+课程设计,java,jsp,SQL server
    • jsp+servlet网上订餐系统
      jsp+servlet+ajax实现的简单网上订餐系统
    • jsp+mysql网上订餐系统
      采用tomcat作为服务器,mysql为数据库,可作为课程设计
    • 基于JSP网上订餐系统
      订餐系统是用HTML语言做的,中间穿插有JSP,有JAVA,能实现网上订餐的基本功能
    • jsp开发网上订餐系统
      这是用java/Servert总控来实现,核心在购物车的使用,这是Servert ,Sessions的运用。
    • 网上订餐系统JSP.zip
      jsp+数据库网上订餐系统,含有数据库,流程图,需求分析,源代码,系统设计,visio绘图,项目立项,项目答辩
    • 基于JSP网上订餐管理系统.zip
      作为网上订餐管理系统主要是为顾客提供便捷,全面的订餐服务,重点要放在面对顾客的页面功能上,其次是管理员对餐品以及餐厅的管理
    • BBS_system_on_java.rar
      BBS论坛系统由JAVA和JSP实现,开发中涉及JavaBean,JSP和服务器Tomcat5.0.7的设置,数据库用SQL2000。有注册登陆,浏览,发帖 回帖,帖子管理,论坛设置,管理版块,用户管理等模块。