http://localhost:8090/gami/review/myReviewList.do

views/mypage/나의 리뷰 경로 만들어주기

<li class="sub-ul_li"><a href="${contextPath}/review/myReviewList.do" class="sub-nav_a">나의 리뷰</a></li>

image.png

  1. 컨트롤러에서 가져온 값 (Map: myReviewMap)를 꺼낸다.
<!-- 리뷰내역 -->
<c:if test="${not empty myReviewMap.myReviewList}">
<c:forEach var="review" items="${myReviewMap.myReviewList}">
    <div class="review-item">
<!-- 이미지 있을 때 -->
<div class="review-image-box">
<c:set var="hasImage" value="false"/>
<c:forEach var="image" items="${myReviewMap.imageList}">
<c:if test="${image.articleNO == review.reviewNo && not empty image.imageFilename}">
<img src="${pageContext.request.contextPath}/review/imagesReview.do?reviewNo=${review.reviewNo}&imageName=${image.imageFilename}" class="review-img"/>
<c:set var="hasImage" value="true"/>
</c:if>
</c:forEach>
/* 이미지 없는 경우 스타일 */
.review-img.placeholder {
    width: 100px;
    height: 100px;
    background-color: #f3f3f3;
    border: 1px dashed #ccc;
    border-radius: 5px;
}
<!-- 이미지 없을때 -->
		<c:if test="${not hasImage }">
		<div class="review-img placeholder"></div>
		</c:if>
		</div>
  1. 리뷰제목과 리뷰 내용을 띄운다
<!-- 리뷰 제목, 리뷰 내용 -->
<div class="review-content">
<a href="/gami/product/selectProduct.do?productNO=${review.productNo}&productName=${review.productName}">
<h3>${review.productName}</h3>
</a>
<p>${review.reviewContents}</p>
  1. 리뷰 별점을 띄운다.
		<!-- 별점 -->
		<c:forEach var="i" begin="1" end="5">
		<c:choose>
			<c:when test="${i <= review.reviewStarAvg }">
			<img src="${contextPath}/resources/image/iconStar1.png" width="15px" alt="노란별" />
			</c:when>
			<c:otherwise>
			<img src="${contextPath}/resources/image/iconStar2.png" width="15px" alt="까만별"/>
			</c:otherwise>
		
		</c:choose>
		</c:forEach>