Notice
Recent Posts
Recent Comments
Link
«   2024/07   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

view_all 본문

JSP/DB (3)

view_all

GAWON 2023. 6. 1. 09:21
<%@page import="org.joonzis.ex.GreenDao"%>
<%@page import="org.joonzis.ex.GreenDto"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	List<GreenDto> list = GreenDao.getInstance().getAllList();
	pageContext.setAttribute("list", list);
%>    
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<jsp:include page="index.jsp"/>
	
	<br><hr><br>

	<h1>green 테이블의 전체 데이터</h1>
	<table>
		<thead>
			<tr>
				<th>회원 번호</th>
				<th>아이디</th>
				<th>비밀번호</th>
				<th>이름</th>
				<th>나이</th>
				<th>주소</th>
				<th>가입일</th>
			</tr>
		</thead>		
		<tbody>	
			<c:choose>
				<c:when test="${not empty list }">
					<c:forEach var="dto" items="${list }">
					<tr>
						<td>${dto.idx }</td>
						<td>${dto.id }</td>
						<td>${dto.pw }</td>
						<td>${dto.name }</td>
						<td>${dto.age }</td>
						<td>${dto.addr }</td>
						<td>${dto.reg_date }</td>
					</tr> 
					</c:forEach>
				</c:when>
				<c:otherwise>
					<tr>
						<td colspan="7">member가 없습니다.</td>
					</tr>
				</c:otherwise>
			</c:choose>
		</tbody>
	</table>	
</body>
</html>

'JSP > DB (3)' 카테고리의 다른 글

view_one  (0) 2023.06.01
Update_page  (0) 2023.06.01
Update  (0) 2023.06.01
Remove  (0) 2023.06.01
Insert  (0) 2023.06.01