교육자료
https://www.youtube.com/watch?v=wCCMoUatat8&list=PLumVmq_uRGHgBrimIp2-7MCnoPUskVMnd&index=18
@GetMapping("/members")
public String list(Model model){
List<Member> members= memberService.findMembers();
model.addAttribute("members",members);
return "members/memberList";
}
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<title>Title</title>
</head>
<body>
<div class ="contaioner">
<table
<thead>
<tr>
<th>#</th>
<th>이름</th>
</tr>
</thead>
<tbody>
<tr th:each="member: ${members}">
<td th:text="${member.id}"></td>
<td th:text="${member.name}"></td>
</tr>
</tbody>
</div>
</body>
</html>
데이터가 메모리에 저장 되어있기에 서버 껐다 키면 사라짐
다음시간 DB 설치 및 사용방법
'개발 > spring' 카테고리의 다른 글
spring jdbctemplate (0) | 2022.11.30 |
---|---|
spring h2 데이터 베이스 및 사용 다형성 예시 (0) | 2022.11.29 |
회원 웹기능 홈 화면 추가 웹기능 등록 (0) | 2022.11.28 |
spring 스프링 빈과 의존관계 1) 컴포넌트 스캔 (0) | 2022.11.28 |
도메인 레퍼지토리 서비스 (0) | 2022.11.25 |
댓글