-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct_detail.jsp
72 lines (65 loc) · 3.26 KB
/
product_detail.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<%@ page contentType = "text/html;charset=utf-8" %>
<%@ page import = "dto.Product" %>
<%@ page import = "java.util.Date" %>
<%@ page import = "example.*" %>
<%@ page errorPage = "../exception/product_not_found.jsp" %>
<jsp:useBean id="productDAO" class="dao.ProductRepository" scope="session"/>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script type="text/javascript">
function addToCart() {
if (confirm("상품을 장바구니에 추가하시겠습니까?")) {
document.addForm.submit();
} else {
document.addForm.reset();
}
}
</script>
<title>상품 상세 정보</title>
</head>
<body>
<%@ include file="top_banner.jsp" %>
<%@ include file="top_menu.jsp" %>
<div class="jumbotron">
<div class="container">
<h1 class="display-3">상품 상세 정보</h1>
</div>
</div>
<%
String id = request.getParameter("id");
Product product = productDAO.getProductById(id);
%>
<div class="container">
<div class="row">
<div class="col-md-6">
<h3><%=product.getPname()%></h3>
<p><%=product.getDescription()%>
<p><b>상품 코드 : </b><span class="badge badge-danger"> <%=product.getProductId()%></span>
<p><b>제조사</b> : <%=product.getManufacturer()%>
<p><b>분류</b> : <%=product.getCategory()%>
<p><b>재고 수</b> : <%=product.getUnitsInStock()%>
<h4><%=product.getUnitPrice()%>원</h4>
<p>
<form name="addForm" action="cart/product_cart_add.jsp?id=<%=product.getProductId()%>" method="post">
<a href="#" class="btn btn-info" onclick="addToCart()"> 상품 주문 »</a>
<a href="cart/product_cart.jsp" class="btn btn-warning"> 장바구니 »</a>
</form>
<div class="card bg-dark text-white">
<img src="https://jsp-main--jfjgw.run.goorm.io/img/product/<%=product.getProductId()%>.jpg" class = "card-img" alt = "...">
<div class="card-img-overlay">
<h5 class="card-title">상품 이미지 원본</h5>
<p class="card-text">출처 : 구글 검색</p>
</div>
</div>
<p><a href="#" class="btn btn-info"> 상품 주문 »</a> <a href="index.jsp" class="btn btn-secondary"> 상품 목록 »</a>
</div>
</div>
<hr>
</div>
<%@ include file="footer.jsp" %>
</body>
</html>