..
prodList.jsp
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

<%@ page import="product.*" language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" errorPage="/error.jsp"%>
<jsp:useBean id="productList" class="java.util.ArrayList" scope="request" />
<%--<jsp:useBean id="productBean" class="product.ProductBean" scope="request" />--%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>

<%-- <%@ include file="/common/top.jsp" %> --%>

<jsp:include page="/common/top.jsp" >
 <jsp:param name="title" value="list view"/>
</jsp:include>

</head>
<BODY>
<form action="" method='POST'>
<br/>
<br/>
<center>
<table width="70%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">

<tr><td colspan="10" align="center" style="font-size:16px; font-weight:bold"> 기자재 목록</td></tr>
<tr height="2" bgcolor="7E7B7B">
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
</tr>
<tr height="17" bgcolor="DEDBDE" align="center">


 
 <td width="45">no.</td>
 <td  width="200">자산번호</td>
 <td width="150">분류코드명</td>
 <td width="200">기자재명</td>
 <td width="200">등록일</td>
 <td width="70">관리자</td>
 <td width="120">보관장소</td>
 <td width="80">남은날</td>
 <td width="120">불용여부</td>
</tr>
<tr height="1" bgcolor="A5A6A5">

 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
</tr>
<%
 int total = productList.size();
 int pageSize = 2;
 String pageNum = request.getParameter("num");
 int pageCount = total / pageSize + ((total%pageSize)==0?0:1);//페이지 몇개?
 ProductBean productBean = null;
 
 if(pageNum == null){
  pageNum = "1";
 }
 
 int currentPage = Integer.parseInt(pageNum);
 int startNum = 1+ (currentPage-1)*pageSize; //페이지 첫번호
 int endNum = (pageCount == currentPage)?(startNum+(total%pageSize)-1):startNum+(pageSize-1);
 
// if (endNum ==0)
//  endNum = 10;//페이지 끝번
 
// if(total != 0){
 for(int i= startNum-1 ; i < endNum; i++){
  productBean = (ProductBean)productList.get(i);
// }
%>

<tr height="23" align="center">
 
 <td class="board_no"><%=productBean.getProdId() %></td>
 <td><div id="prodNo"><%=productBean.getProdNo() %></div></td>
 <td class="board_title" align="left">7110-004-0139</td>
 <td class="board_name"><a href="/webProduct/product/productView.do?prodNo=<%=productBean.getProdNo() %>"><%=productBean.getProdName() %></a></td>
 <td class="board_date">2007-01-30</td>
 <td class="board_hit"><%=productBean.getProdChargeName() %></td>
 <td class="board_down">55506</td>
 <td class="board_good">3년</td>
 <td class="board_bad">N</td>
</tr>

<tr height="1" bgcolor="E3DFDF">

 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
</tr>

<%} %>
<tr height="2" bgcolor="7E7B7B"><td colspan="16"></td></tr>
<tr>
 
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td></td>
 <td>

 <a href="/webProduct/product/insertForm.jsp"> <img src="/webProduct/image/b_write.gif" /></a>
 </td></tr>
</table>

<%
 int backPage = 0;
 
 if(currentPage == 1){
  backPage = 1;
%>
  [Back]
<%
 }else{
  backPage = currentPage-1;
%>

 <a href="/webProduct/product/productList.do?num=<%=backPage%>">[Back]</a>
<%
 }
 for(int i = 1; i <= pageCount; i++){
 
  if(currentPage == i){
%>
   [<%=i%>]
<%
  }else{
%>  
  <a href="/webProduct/product/productList.do?num=<%=i%>">[<%=i%>]</a>
<%  
  }
 }
%>
<%
 int nextPage = 0;
 
 if(currentPage == pageCount){
  nextPage = pageCount;
%>
  [Next]
<%
 }else{
  nextPage = currentPage+1;
%>

 <a href="/webProduct/product/productList.do?num=<%=nextPage%>">[Next]</a>
<%
}
%>
</center>

<!--리스트 목록 끝-->
</form>
<jsp:include page="/common/footer.jsp">
 <jsp:param name="email" value="korigp21@naver.com"/>
 <jsp:param name="tel" value="041-634-3128"/>
</jsp:include>
</BODY>
</html>

  Comments,     Trackbacks