이제 클릭한 회원의 정보를 볼 수 있는 화면 코드를 작성합니다.
관리자가 특정 회원의 상세 정보를 확인하고 필요하면 권한을 바꿀 수 있는 기능을 만듭니다.
우선 조회 기능만 구현하고 수정과 삭제는 뒤에서 추가합니다.
src/main/resources/templates 폴더에서 우클릭 → New → HTML File → edit.html을 선택합니다.
생성된 edit.html에 아래 코드를 입력합니다.
▼ Code
Path: templates/edit.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>회원 정보</title>
</head>
<body>
<h2>회원 정보</h2>
<table border="1" cellpadding="5">
<tr>
<th>ID</th>
<td th:text="${member.id}"></td>
</tr>
<tr>
<th>이름</th>
<td th:text="${member.name}"></td>
</tr>
<tr>
<th>이메일</th>
<td th:text="${member.email}"></td>
</tr>
<tr>
<th>권한</th>
<td th:text="${member.role}"></td>
</tr>
</table>
<br>
<button type="button" onclick="location.href='/members'">목록</button>
</body>
</html>
개인정보처리방침 · 이용약관