${dto.seq } |
${dto.subject } |
${dto.name } |
${dto.logtime } |
${dto.hit }<">
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="<http://java.sun.com/jsp/jstl/core>" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>boardListResult.jsp</title>
<style type="text/css">
table, tr, td {
border: 1px solid black;
border-collapse: collapse;
}
td {
text-align: center;
}
#paging-block {
width: 1000px;
text-align: center;
}
#paging{
color: black;
text-decoration: none;
}
#currentPaging {
color: red;
text-decoration: underline;
}
</style>
</head>
<body>
<br><br>
<h1>글목록</h1>
<br>
<table>
<tr>
<th width="100px"> 글번호 </th>
<th width="500px"> 제 목 </th>
<th width="150px"> 작성자 </th>
<th width="150px"> 작성일 </th>
<th width="100px"> 조회수 </th>
</tr>
<c:forEach var="dto" items="${list }">
<tr>
<td>${dto.seq }</td>
<td><a href="#" onclick="isLogin(${dto.seq }, ${pg })">${dto.subject }</a></td>
<td>${dto.name }</td>
<td>${dto.logtime }</td>
<td>${dto.hit }</td>
</tr>
</c:forEach>
</table>
<br/><br/>
<!-- 페이징 -->
<div id="paging-block">
<c:if test="${startPage > block }">
[<a href="boardList.jsp?pg=${startPage -1 }" id="paging">이전</a>]
</c:if>
<c:forEach var="i" begin="${startPage }" end="${endPage }" step="1">
<c:if test="${i == pg }">
[<a href="boardList.jsp?pg=${i}" id="currentPaging">${i}</a>]
</c:if>
<c:if test="${i != pg }">
[<a href="boardList.jsp?pg=${i}" id="paging">${i}</a>]
</c:if>
</c:forEach>
<c:if test="${endPage < totalPage }"> <%-- endPage가 총 페이지보다 작을 때 --%>
[<a href="boardList.jsp?pg=${endPage +1 }" id="paging">다음</a>]
</c:if>
</div>
<br><br>
<input type="button" value="main" onclick="location.href='../main/index.jsp'" style="display: flex; justify-content: center;"/>
<script type="text/javascript">
function isLogin(seq,pg) {
<% if(session.getAttribute("memberId") == null) { %>
alert("로그인하세요...");
<%} else { %>
location.href="boardView.jsp?seq="+seq+"&pg="+pg;
<% } %>
}
</script>
</body>
</html>
|