<c:if test="${m.rownum % 2 == 0}">
// 만약 m.rownum을 2로나눈 나머지가 0이면
<c:set var="color" value="#FFD9EC" />
// 변수 color의 값을 #FFD9EC로 선언
</c:if>
<c:if test="${m.rownum % 2 == 1}">
// 만약 m.rownum을 2로나눈 나머지가 1이면
<c:set var="color" value="#BCE9B7" />
// 변수 color의 값을 #BCE9B7로 선언
</c:if>
<tr bgcolor= "${color}" >
// tr의 bgcolor값에 변수 color에 받아온 값을 대입한다.
1:페이지사이즈: <%=page_size %>  
2:페이지List Size: <%=page_list_size %> 
3:총레코드 수 :<%=tc %>  
4.총페이지수: <%=pagetotal %> <br>
5.현재레코드: <%=now_Record %> 
6.현재페이지:<%=now_page %>  
7. 하단 가로 시작페이지: <%=start_page %>  
8. 하단 가로 마지막페이지: <%=end_page %>
package dao;
import java.sql.*;
import java.util.ArrayList;
import java.util.List;
import conn.DBConn;
import model.guestVo;
public class BigListDaoImpl {
DBConn db = DBConn.getInstance();
Connection con = null;
String sql = null;
PreparedStatement pstmt = null;
PreparedStatement pstmt1 = null;
ResultSet rs = null;
ResultSet rs1=null;
List<guestVo> list = null;
String sql1 = null;
public List<guestVo> selectAll(guestVo g){
list = new ArrayList<guestVo>();
try {
int page_size =10;
int page_list_size = 10;
con = db.getConnect();
sql = "select rownum, p.* from " ;
sql = sql + " (select rownum as rn, k.* from ";
sql = sql + " (select * from guest order by custno desc)k ";
sql = sql + " where rownum <= ? " ;
sql = sql + " )p where rn >= ? ";
pstmt = con.prepareStatement(sql);
int now_Record = g.getNow_Record();
int startno = now_Record;
int endno = now_Record + page_size - 1 ;
pstmt.setInt(1, endno);
pstmt.setInt(2, startno);
rs = pstmt.executeQuery() ;
sql1 = " select count(*) as tc from guest ";
pstmt1 = con.prepareStatement(sql1);
rs1 = pstmt1.executeQuery() ;
rs1.next();
int tc = rs1.getInt("tc");
int pagetotal = (int) (Math.ceil((double) tc / page_size));
int now_page = (int) (Math.ceil((now_Record )/page_size) + 1) ;
int start_page =(now_page-1)/page_list_size * page_list_size + 1 ;
int end_page = start_page + page_list_size -1 ;
System.out.println("1.["+page_size+"] 2.["+page_list_size+"] 3.["+tc+"] 4.["+pagetotal+"] 5.["+ now_Record+"] 6. ["+now_page+"] 7.["+start_page+"] 8.["+end_page+"]");
while(rs.next()) {
g = new guestVo();
g.setRownum(rs.getInt("rownum"));
g.setRn(rs.getInt("rn"));
g.setCustno(rs.getInt("custno"));
g.setCustname(rs.getString("custname"));
g.setPhone(rs.getString("phone"));
g.setAddress(rs.getString("address"));
g.setJoindate(rs.getString("joindate"));
list.add(g);
}
} catch (Exception e) {
e.printStackTrace();
}finally {
try {
if( rs != null) {rs.close();}
if( pstmt != null) {pstmt.close();}
if( con != null) {con.close();}
} catch (Exception e) {
e.printStackTrace();
}
}
return list;
}
}