thymeleaf 사용 Data 받아오기
<div class="desc-area">
<h5 th:text="${title}" >에밀</h5>
<h6 th:text="${price} + ' 원'">가격 : 35000 원</h6>
<h6 th:text="'작가 : '+ ${author}">작가 : 장 자크 루소</h6>
<h6 th:text="'출판사 : '+${publish}">출판사 : 육문사</h6>
<h6 th:text="'별점 : ' + ${star} + ' / 발행년도 : ' + ${year} + '.' + ${month}">별점 : 8 / 발행년도 : 2012.3</h6>
</div>
thymeleaf 사용하여 받아온 Data를 이용해 page 이동
<div class="book-box" type="button" th:onclick="|location.href='@{/detail/{id}(id=${id})}'|">
<div class="image-area">
<img th:src="${image}" alt="My Image" width="110" height="170"/>
</div>
</div>
|location.href='@{/detail/{id}(id=${id})}'| 해당 부분을 이용하여 id 값의 변화 없이 정상적으로 html page 연결
/detail/7$@%# 이 아닌 /detail/01 이런 형식으로 온전하게 전달
728x90
'ssung_항해일지 > 항해99_실전 프로젝트' 카테고리의 다른 글
실전 프로젝트 - 9일차 (0) | 2023.03.19 |
---|---|
실전 프로젝트 - 8일차 (0) | 2023.03.17 |
실전 프로젝트 - 5일차 (0) | 2023.03.15 |
실전 프로젝트 - 4일차 (0) | 2023.03.14 |
실전 프로젝트 1일차 (0) | 2023.03.11 |