- 해결방법
이렇게 mapper와 service의 파일 위치를 지정해줘야한다
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}" />
<link rel="stylesheet" th:href="@{/css/bootstrap.min.css.map}" />
</head>
<body>
<h2>게시글목록</h2>
<table class="table table-hover">
<thead>
<tr>
<th scope="col">글번호</th>
<th scope="col">제목</th>
<th scope="col">작성자</th>
<th scope="col">조회수</th>
<th scope="col">날짜</th>
</tr>
</thead>
<tbody>
<tr th:each="one : ${list}">
<th th:text="${one.no}"></th>
<th th:text="${one.title}"></th>
<th th:text="${one.writer}"></th>
<th th:text="${one.hit}"></th>
<th th:text="${one.regdate}"></th>
</tr>
</tbody>
</table>
</body>
</html>
<tr th:each="one : ${list}">
<th th:text="${one.no}"></th>
<th th:text="${one.title}"></th>
<th th:text="${one.writer}"></th>
<th th:text="${one.hit}"></th>
<th th:text="${one.regdate}"></th>
</tr>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}" />
<link rel="stylesheet" th:href="@{/css/bootstrap.min.css.map}" />
</head>
<body>
<form th:action="@{/board/update.do}" method="post">
<input type="text" name="no" th:value="${obj.no}" readonly><br/>
<input type="text" name="title" th:value="${obj.title}"><br/>
<input type="text" name="content" th:value="${obj.content}" ><br/>
<input type="text" name="writer" th:value="${obj.writer}"><br/>
<input type="text" th:value="${obj.hit}" readonly><br/>
<input type="text" th:value="${obj.regdate}" readonly><br/>
<input type="submit" value="수정"><br/>
</form>
</body>
</html>
xml에서 직접 sql을 작성해서 DB와 연동한다.
기존에 Mapper에 있는 interface명이랑 class명과 type이 같아햐 한다
위치도 설정해줍니다