(Digital Convergence) Java & Spring-based AWS Cloud Convergence Developer Training Course (F)Day 57 Hahaha MondayModify additional order quantity for today’s shopping mall shopping cart, delete shopping cart products, and view order shopping details Implementation 16_Minimal/loginPro [Login Process]<%@page import=”my.member.Members DAO”%><%><%@page image image.m.m.m.Members DTO” page <%@page=”<%>Contactml) page Enterprise<:/html) page Enterprise<TF-8> page Enterprise<TF-8>.setCharacterEncoding(“)UTF-8”);tring id = request.getParameter(“id”);tring password = request.getParameter(“password”); // 메인에서 보내는 2 가지를 받아옴 system.out.println(“loginPro.jspid:”+id); // main에서 입력한 로그인 아이디가 잘 넘어가는지 확인/ mall_top.jsp 까지 넘어가게끔 세션으로 설정 メンバーDAomdao = MemberDAO.getInstance(); メンバDTOmb = mdao.getMemberInfo(id,password);tringviewPage; // 관리자、일반회원이 넘어갈 페이지가 다르기 때문에 하나 설정해줌 if(mb!= null){ // 가입한 회원 tring_id = mb.getId();if(id.equals(“admin”){// 관리자 iewPage= request.getContextPath()+”/main.jsp”;}else{ // 일반 회원 Page= request.get/mallPath/shopse.mall/shop。setAttribute(“memid”,id); //여기까지 넘어온 아이디를 memid라는 이름으로 세션 설정ession.setAttribute(“memno”, mb.getNo()); // 여기까지 넘어온 아이디를 memid라는 이름으로 세션 설정} else{ // 가입하지 않은 회원 iewPage=request.getContextPath()+”/main.jsp”;%><scripttype=”text/javascript”>alert(‘가입하지 않은 회원입니다.’);</script><%}/else%><scripttype=”text/javascript”>ocrimescript.> ocrite.>ocation。href=”<%=viewPage%>;</script>16_ Mini Mall/My Shop/Display/Mall_ProdView [상품 상세보기]16_ Mini Mall/My Shop/Display/Mall_ProdView [상품 상세보기]16_Minimall/myshop/display/mall_CartList.jsp[장바구니 목록]16_Minimall/myshop/display/mall_CartList.jsp[장바구니 목록]16_Minimall/myshop/display/mall_CartAdd.jsp[장바구니 추가]16_Minimall/myshop/display/mall_CartAdd.jsp[장바구니 추가]16_ Minimum/myshop/display/mall_CartEdit.jsp [Shopping basket quantity modification]16_ Minimum/myshop/display/mall_CartEdit.jsp [Shopping basket quantity modification]16_Minimall/myshop/display/mall_CartDel.jsp[장바구니 삭제]<%@page=” content is the type=” content, type=” content, type=UTF-8page<EningTF-U”/)”>all_TFistですl@”です— => mall_cartDel.jsp<br><br> –><jsp:useBeanid=”mallCart” class=”my.shop.mall” です.CartDTO” scope=”session”/><%tring pnum = request.getParameter(“pnum”);allCart.delProd(pnum);%><script type=”text/javascript”>alert(‘상품이 삭제되었습니다.’); 場所です.href=”mall_cartList.jsp”;</script> です16_Minimall/my/mall/CartDTO.java16_Minimall/my/mall/CartDTO.java16_ This is Minimall/MyMall/Order DTO.javapackage my.shop.mall;public クラス OrderDTO {//hopping_list=> 고객명 아이디 상품명 수량 금액 private String mname;private String pname;private int qty;private int amount;public String getMname() {this.mname = mname;}public String getMid(String) {this.mid;} public void) mid。mid = mid;}public String getPname() {return pname;}public void setPname(String pname) {this.pname = pname;}public int getQty() {this.qty = qty;}public int Amount() {returnamount}public void setAmount(intamount;} public voadmount;}}16_ This is Minimall/MyMall/Order DAO.java16_ This is Minimall/MyMall/Order DAO.java16_ This is Minimall/MyMall/Order DAO.javaImport the package my.shop.mall;java.sql.Connect; import java.sql.PreparedStatement; Import java.sql.ResultSet; Import java.sql.Import SQLException;java.util.Import vector;javax.naming.context; Import javax.naming.Import InitialContext;javax.naming.naming exception; Import javax.sql.DataSource; Import my.member.Import member DTO; my.shop.製品DですTO;public クラス OrderDAO {onnection conn};reparedStatement ps = null;esultSetrs = null;publicOrderDAO() {nitContext = newInitialContext(); ontext envContext.lookup(“java:comp/env”);//xml 안의 설정 정보가 java:comp/envataDsourcontext/dsource(dbc”Source(dbcontext)。getConnection();system.out.println(“conn:”+conn) です;} catch (name) exception e) {.printStackTrace();} catch (SQLEException e) {.printStackTrace();}} //OrderDao 생성자 publicintinsertOrder(int memno, Vector<Product)DTO> cv) は例外 {nt cnt=0;nt sum=0;try {onn.setAutoCommit(false);for(inti=0;i<cv.size();i++) {tring sql = “注文値に挿入(orderseq.nextval,????)”?”;s = conn.prepreprepreStatement(sql);s.setInt(2, cv(mno);s.get(s.get(m。getPrice() * cv.get(i).getPqty();nt +=ps です.executeUpdate();}if(cnt==cv.size()) {onn.commit();} catch (SQLException e) {.printStackTrace()}return cnt;}//insertOrderpublicVector<OrderDTO> getOrderList(Stringid) {ector<OrderDTO> List = newVector<OrderDTO>(();();tring = “m.name , m.id , name”+ “from (members minner join orders o on m.no = o.memno) inner join product pono.pnum = p.pnum\r\n Run the command”+ “Where is id=?”;{s = conn.prepareStatement(sql);s.setString(1, id);s = ps.executeクエリ();while(rs.next());b.setMname(rs.getString(“mname”);b.setMid(rs.getString(“id”));b.setPname(rs.getString(“pname”));b.setQty(rs.getInt((“qty”));b.setAmount (getInts,Exception,Exception));Ats。size();リストを返します;}//getOrderList}