Package com.lei.dao

Examples of com.lei.dao.ProductDao


    String id=request.getParameter("proid");
    String name=request.getParameter("proname");
    String price=request.getParameter("proprice");
   
    Product pro=new Product();
    ProductDao pd=new ProductDao();
    pro.setId(id);
    pro.setName(name);
    pro.setPrice(2);
    pro.setShangjia(true);
 
    pd.save(pro);
    response.sendRedirect("product.jspx?task=all");
  }
View Full Code Here


  }

  private void all(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
   
    HttpSession session=request.getSession();
    ProductDao dao=new ProductDao();
    List<Product> list=dao.findAll();
    session.setAttribute("prolist", list);
    request.getRequestDispatcher("main.jsp").forward(request, response);
   
  }
View Full Code Here

    String id=new String(request.getParameter("id").getBytes("ISO8859-1"),"UTF-8");
    String name=request.getParameter("name");
    float price=Float.parseFloat(request.getParameter("price"));
   
    Product pro=new Product();
    ProductDao pd=new ProductDao();
   
    pro.setId(id);
    pro.setName(name);
    pro.setPrice(price);
    pro.setShangjia(true);
    pd.save(pro);
   
    List<Product> list=pd.findAll();
   
    PrintWriter out=response.getWriter();
    out.print("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
    out.print("<product>");
    for(Product p:list){
View Full Code Here

TOP

Related Classes of com.lei.dao.ProductDao

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.