NtPage. jsp (preferred for SUN Enterprise applications)
-------------------------------------------------------------------
<%
Int PAGESIZE = 10;
Int old_PAGESIZE = PAGESIZE;
Int curPage = 1;
Int pageCount = 0;
Int iStart = 0;
Int iCount = 0;
Int totalRecordCount = ntP. rowCount;
Boolean onlyOnePage = true;
Try {
If (request. getParameter ("pagesize ")! = Null)
PAGESIZE = Integer. parseInt (request. getParameter ("pagesize "));
If (request. getParameter ("pagesize_post ")! = Null)
PAGESIZE = Integer. parseInt (request. getParameter ("pagesize_post "));
} Catch (Exception ePage13 ){
PAGESIZE = old_PAGESIZE;
}
If (PAGESIZE <totalRecordCount)
OnlyOnePage = false;
Try {
CurPage = Integer. parseInt (request. getParameter ("page "));
} Catch (Exception e ){
CurPage = 1;
}
If (totalRecordCount> 0)
{
PageCount = totalRecordCount/PAGESIZE;
If (totalRecordCount % PAGESIZE! = 0)
PageCount + = 1;
If (curPage <1)
CurPage = 1;
If (curPage> pageCount)
CurPage = pageCount;
IStart = (curPage-1) * PAGESIZE;
ICount = totalRecordCount-iStart;
If (iCount> PAGESIZE)
ICount = PAGESIZE;
ICount = iStart + iCount;
}
%>