Controller 에서, 전달 할 Model, ModelAndView 이름을 resultList, 이름 필드 명 name, 전화번호 필드명을 phoneNum으로 지정 했다고 가정.
<table name="phoneNumList" border= "1">
<colgroup>
<col width="150px" />
<col width="150px" />
</colgroup>
<thead>
<tr>
<td style="font-weight: bold;">이름</td>
<td style="font-weight: bold;">전화번호</td>
</tr>
</thead>
<tbody>
<c:forEach items="${resultList}" var="List">
<tr>
<td>${List.name}</td>
<td>${List.phoneNum}</td>
</tr>
</c:forEach>
</tbody>
</table>
jsp 상단에 아래의 라이브러리 추가
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
'뒤죽박죽 머리속' 카테고리의 다른 글
javascript 새 창 띄우기 (0) | 2016.11.01 |
---|---|
List 출력 활용 (가로로 출력) (0) | 2016.11.01 |
jsp 중복 submit 방지 (0) | 2016.10.31 |
List 형식의 Form 필드 합계 (0) | 2016.10.31 |
List 형식의 Form 값 전송을 위한 null 체크 (1) | 2016.10.31 |