반응형
Notice
Recent Posts
Recent Comments
Link
관리 메뉴

bro's coding

JSP.Paging 본문

[IT]/JSP

JSP.Paging

givemebro 2021. 5. 4. 11:46
반응형
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<table class="table table-bordered  table-hover boardlist">
	<thead>
		<tr class="success">
			<th>번호</th>
			<th class="title">제목</th>
			<th>작성자</th>
			<th>작성일</th>
			<th>조회</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="pvo" items="${requestScope.list}">
			<tr>
				<td>${pvo.no }</td>
				<td><c:choose>
						<c:when test="${sessionScope.mvo!=null}">
							<a href="${pageContext.request.contextPath}/PostDetailController.do?no=${pvo.no }">	${pvo.title }</a>
						</c:when>
						<c:otherwise>
				${pvo.title }
				</c:otherwise>
					</c:choose></td>
				<td>${pvo.memberVO.name }</td>
				<td>${pvo.timePosted }</td>
				<td>${pvo.hits }</td>
			</tr>
		</c:forEach>
	</tbody>
</table>
<%-- 페이징 처리 --%>
<%-- ${requestScope.pagingBean} --%>
<c:set var="pb" value="${requestScope.pagingBean}"></c:set>
<div class="pagingArea">
	<ul class="pagination">
	<c:if test="${pb.previousPageGroup}">
	<li><a href="ListController.do?pageNo=${pb.startPageOfPageGroup-1}">&laquo;</a></li>
	</c:if>
		<c:forEach var="page" begin="${pb.startPageOfPageGroup}" end="${pb.endPageOfPageGroup}">
		<c:choose>
			<c:when test="${pb.nowPage==page}">
			<li class="active"><a href="ListController.do?pageNo=${page}">${page}</a></li>
			</c:when>
			<c:otherwise>
			<li><a href="ListController.do?pageNo=${page}">${page}</a></li>
			</c:otherwise>
		</c:choose>		
		</c:forEach>
	<c:if test="${pb.nextPageGroup}">
	<li><a href="ListController.do?pageNo=${pb.endPageOfPageGroup+1}">&raquo;</a></li>
	</c:if>	
	</ul>
</div>

 

 

SQL.Paging

paging 방법 Paging SQL(row_number() 와 subquery의 inline view를 이용하고회원 테이블과 join) drop table player; create table player( no number primary key, title varchar2(100) not null, singer varcha..

broscoding.tistory.com

 

 

java.Paging

package org.kosta.webstudy25.model; /** * 페이징 처리를 위한 비즈니스 계층의 클래스 PagingBean method 구현순서 * getStartRowNumber() * getEndRowNumber() * getTotalPage() * getTotalPageGroup() * getN..

broscoding.tistory.com

 

반응형

'[IT] > JSP' 카테고리의 다른 글

JSTL.forEach.begin/end  (0) 2021.04.23
JSTL.MAP  (0) 2021.04.23
JSTL.forEach  (0) 2021.04.23
JSTL.Choose  (0) 2021.04.23
JSTL.if  (0) 2021.04.23
JSTL.taglib  (0) 2021.04.23
EL.ServletContext  (0) 2021.04.23
EL.session  (0) 2021.04.23
Comments