Notice
Recent Posts
Recent Comments
Link
«   2025/03   »
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

allList 본문

JSP/SEARCH

allList

GAWON 2023. 6. 12. 17:09
<%@page import="org.joonzis.dao.EmployeeDaoImpl"%>
<%@page import="org.joonzis.vo.EmployeeVO"%>
<%@page import="org.joonzis.dao.EmployeeDao"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix="c"%>   
<% 
	List<EmployeeVO> list = EmployeeDaoImpl.GetInstance().getALLEmployees();
	pageContext.setAttribute("list", list);
%>	
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
	div{
		width: 800px;
		text-align: center;
		margin: auto;
	}
	table {
		width: 100%;
		border-collapse: collapse;
	}
	th,td{
		border: 1px solid gray;
	}
	th{
		padding: 5px;
		background-color: blue;
		color: white;
	}

</style>
</head>
<body>
	<div>
		<h1>전체 직원 목록</h1>
		<table>
			<thead>
				<tr>
					<th>직원</th>
					<th>이름</th>
					<th>연락처</th>
					<th>연봉</th>
					<th>부서ID</th>
					<th>고용일</th>
				</tr>
			</thead>
			<tbody>
				<c:choose>
					<c:when test="${not empty list }">
						<c:forEach var ="vo" items="${list }">
							<tr>
								<td>${vo.employee_id }</td>
								<td>${vo.first_name }${vo.last_name}</td>
								<td>${vo.phone_number }</td>
								<td>${vo.salary }</td>
								<td>${vo.department_id }</td>
								<td>${vo.hire_date }</td>
							</tr>	
						</c:forEach>
					</c:when>
					<c:otherwise>
						<tr>
							<td colspan="6">전체 목록보기</td>
						</tr>	
					</c:otherwise>
				</c:choose>
			</tbody>
		</table>
	</div>
</body>
</html>

'JSP > SEARCH' 카테고리의 다른 글

dynamic  (0) 2023.06.12
daptList  (0) 2023.06.12
EmployeeVO  (0) 2023.06.12
EmployeeServiceImpl  (0) 2023.06.12
EmployeeService  (0) 2023.06.12