
리스트 테스트를 위해 위 코드로 게시글을 만듦
- 게시글 리스트



- 리스트 게시글 클릭


PostView.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>게시글 리스트 페이지</title>
</head>
<style>
.layout {
width: 500px;
margin: 0 auto;
margin-top: 40px;
}
</style>
<body>
<div class="layout">
<table >
<thead>
<tr>
<th>글 번호</th>
<th>제목</th>
</tr>
</thead>
<tbody>
<tr th:each="post : ${list}">
<td th:text="${post.id}">1</td>
<td>
<a th:text="${post.title}" th:href="@{/post/view(id=${post.id})}"></a>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
PostView.html
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>게시글 상세 페이지</title>
</head>
<body>
<h1 th:text = "${post.title}">제목입니다.</h1>
<p th:text = "${post.content}">내용이 들어갈 부분입니다.</p>
</body>
</html>'Project > Study Website Project' 카테고리의 다른 글
| [String Boot Project] 파일 업로드 (0) | 2025.01.20 |
|---|---|
| [String Boot Project] 게시글 메시지 (1) | 2025.01.20 |
| [Spring Boot Project] 게시글 삭제 및 수정 (0) | 2025.01.14 |
| [Spring Boot Project] 게시글 생성 (0) | 2025.01.13 |
| [Spring Boot Project] Study Website Project (0) | 2025.01.10 |