JPS pagination using JSPtag library

Hi guys,

I've a resultset from mysql, I would like to display only 20 records in a page...so want to use the concept of pagination using jsptag library found at http://jsptags.com/tags/navigation/pager/index.jsp

i'm unable to figure out how this worlks......can any one put some sample code and tell how it works. and also let me know what variables should i pass to what parameters using that tag library.

thankz
LVL 10
jagadeesh_motamarriAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fargoCommented:
You can have a look here
http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_21777860.html

i helped someone to get it done. Please go thru it and let us know if u face problems.
0
jagadeesh_motamarriAuthor Commented:
userList ul = (userList)session.getAttribute("userInformatio");

is userInformatio the result set.....
0
fargoCommented:
yes.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

jagadeesh_motamarriAuthor Commented:
but i never heard of a userlist and userobject in collections...what are they...
0
fargoCommented:
jagadessh...you need not to copy the complete code. UserList or userInformation is asker's application specific code (not in your application). If you wish u can paste your present jsp and we can modify it.
0
jagadeesh_motamarriAuthor Commented:
.....i'm actually in the process of completing some other task thatz related to this question...so it took me time to get back.

I'm using servlets and JSP for my application.  I actually have a resultset in a servlet in List Collection. Now i've it forwarded to my JSP page.. i'm confused on what variables to be passed to what variables.

Can you just give me a brief brush up on this....


jags.
0
fargoCommented:
check my comment below

<%@ page contentType="text/html;charset=ISO-8859-1" language="java" %>
<%@ taglib uri="/WEB-INF/pager-taglib.tld" prefix="pg" %>
<html:html locale="true">
<body topmargin="0" leftmargin="0" rightmargin="0"
<!-- Making use of page tag library -->

// maxIndexPages="25"  25 index pages will be shown in the pager bar at a time
// maxPageItems="20"  20 rows will be displayed in a page

<pg:pager maxIndexPages="25" maxPageItems="20" export="currentPageNumber=pageNumber">
  <pg:param name="pg"/>
  <pg:param name="q"/>

<center>

<%
// the results which u set in servlet is what u wish to display in page.
// so below we get the list and iterate over it
List list = (ArrayList)session.getAttribute("ListOfBeansFromServlet");

for (int i =0; i <list.size(); i++) {

BeanInList row = (BeanInList) list.get(i);

%>    
<pg:item>
<tr>
// get the values from the bean. These are the properties u wish to display in table
// the below can be changed as per your bean properties
<td><%= row.getPid() %></td>
<td><%= row.getName() %></td>
<td > <%= row.getAddress() %></td>
</tr>
</pg:item>
<%
}
%>
</table>

</center>
<br />
<center>
<!-- this is for page indexing ** starts here**-->
  <pg:index>
    <font face=Helvetica size=-1 color=ActiveCaption>Result Pages:
    <pg:prev>&nbsp;<a href="<%= pageUrl%>" style="text-decoration:none">[&lt;&lt; Prev]</a></pg:prev>
    <pg:pages><%
      if (pageNumber.intValue() < 10) {
        %>&nbsp;<%
      }
      if (pageNumber == currentPageNumber) {
        %><b><%= pageNumber %></b><%
      } else {
        %><a href="<%= pageUrl%>" style="text-decoration:none"><%= pageNumber %></a><%
      }
    %>
    </pg:pages>
    <pg:next>&nbsp;<a href="<%= pageUrl%>" style="text-decoration:none">[Next &gt;&gt;]</a></pg:next>
    <br></font>
  </pg:index>
</pg:pager>
</center>
</body>
</html>

Hope it helps.
0
jagadeesh_motamarriAuthor Commented:
BeanInList row = (BeanInList) list.get(i);

what does this line do and where is the start of the table tag.....
0
fargoCommented:
change the section...(see my comments)

.............
<center>
<table> // missed in the code
<%
// the results which u set in servlet is what u wish to display in page.
// so below we get the list and iterate over it
List list = (ArrayList)session.getAttribute("ListOfBeansFromServlet");

for (int i =0; i <list.size(); i++) {

BeanInList row = (BeanInList) list.get(i);
// this gets the bean containing the row information. This can be changed accordingly, if you are using resultset instead of list of beans.

%>    
<pg:item>
..........
0
jagadeesh_motamarriAuthor Commented:
Hi fargo...atlast i tried with what you suggested...and i don't have a clue where i'm going wrong....here is my code...

this complete code by itself is in a table in a <td> </td>

and i have

 <pg:pager maxIndexPages="25" maxPageItems="20" export="currentPageNumber=pageNumber">
    <pg:param name="pg"/>
     <pg:param name="q"/>

just after the body tag
 
             
             <%
             System.out.println("Step - 1");
                  List searchMap = new ArrayList();
                  searchMap = (List)request.getAttribute("searchMap");
                  String tempData ="";
                  String tempData_Key = "";
                  
                  if(searchMap == null || searchMap.size() == 0){
                        String errmsg = "Currently are no Temporary Requests for C4iSR - Suspense Tracking System";
            %>
            
                  <h3 class="labeltxtb" align="center"><%out.write(errmsg);%></h3>
            <%}      else{ %>
                  
      
 
                  <table border="1" bordercolor="#D0B623" align="center" width="589" cellpadding="0" cellspacing="0" title="This table shows the results of the search query">
                  <tr class="labeltxtb">
                  <!-- Here Depending on the Option selected the sequence will be changed-->
                        <th>#</th>
                        <th>SID</th>
                        <th>Internal Due Date </th>
                        <th>Created Date </th>
                        <th>DO THIS</th>
                        
                <pg:item>  
                  <%
                  System.out.println("Step - 2");
                  
                  Iterator i = searchMap.iterator();
                  int j = 1;
      
                  
                  while(i.hasNext()){
                        Vector dataVector = (Vector)i.next();
                        if(dataVector !=null){
                        
                              int dataVectorSize = dataVector.size();
                              String id=dataVector.get(0).toString();
                              out.println("<tr>");
                        
                                    
                              out.println("<td class=\"labeltxt\" align=\"center\" >&nbsp;");
                              out.println(j);
                              out.println("&nbsp;</td>");
                              j++;
                              tempData_Key = dataVector.get(0)==null ?"" :dataVector.get(0).toString();
                              
                              for(int vectorIndex=1;vectorIndex<dataVectorSize;vectorIndex++){
                                    tempData = dataVector.get(vectorIndex)==null ?"" :dataVector.get(vectorIndex).toString();
                                    
                              
                                          
                                    out.println("<td class=\"labeltxt\" align=\"center\" >&nbsp;");
                                    out.println(tempData);
                                    out.println("&nbsp;</td>");
                                    
                                    
                              }// end of for loop
                              
                              
                              System.out.println("Key data: "+tempData_Key);
                              out.println("<td class=\"labeltxt\" align=\"center\" >&nbsp;");
                              out.println("<a href=\"deleteChief.jsp?cid=" + tempData_Key + "\" target=\"_self\" onclick=\"return confirmSubmit(this.form,'Are you sure you want to delete this chief?')\"><font color=\"red\">" + "Delete" + "</font></a>");
                              out.println("&nbsp;</td>");
                                    
                              
                        
                              out.println("</tr>");
                        
                        
                        }// end of if loop
                        else
                        out.println("Unable to retrieve the data properly. please contact system administrator");
                        
                        
                  }//end of while loop      
                              

                                          %>
                  </pg:item>
                        
                  </table>
                   <% }%>
            
             

<!-- this is for page indexing ** starts here -->
  <pg:index>
    <font face=Helvetica size=-1 color=ActiveCaption>Result Pages:
    <pg:prev>&nbsp;<a href=adminMain style="text-decoration:none">[&lt;&lt; Prev]</a></pg:prev>
    <pg:pages><%
      if (pageNumber.intValue() < 10) {
        %>&nbsp;<%
      }
      if (pageNumber == currentPageNumber) {
        %><b><%= pageNumber %></b><%
      } else {
        %><a href=adminMain style="text-decoration:none"><%= pageNumber %></a><%
      }
    %>
    </pg:pages>
    <pg:next>&nbsp;<a href=adminMain style="text-decoration:none">[Next &gt;&gt;]</a></pg:next>
    <br></font>
  </pg:index>
 
</pg:pager>
             

..........................it does not show any paging and more over all the results ended up in the same page.

adminMain  ...is my servlet name. do i have to give my complete urlll
             
0
fargoCommented:
r u generating the above code using the servlet?
Why do u give the pager link to servlet?
Moreover, have u defined the taglib directive for pager taglib at the start of the page?
0
jagadeesh_motamarriAuthor Commented:

my url is something like this

http://garuda:8082/TS/adminMain

adminMain is my servlet that forward the request to display the adminMain.jsp page

so what should be my url?


>>Moreover, have u defined the taglib directive for pager taglib at the start of the page?
yes i did

<%@ taglib uri="/WEB-INF/jsp/pager-taglib.tld" prefix="pg" %>

i've pager-taglib.tld in WEB-INF/jsp/

Jags.

0
fargoCommented:
u need not to define the servlet in pager href. Use the way i said in my previous posts with pageUrl. like follows
href="<%= pageUrl%>"

take a look at the generated html from the jsp. does it have pg kind of tags??
0
jagadeesh_motamarriAuthor Commented:
href="<%= pageUrl%>"  ....i changed to this.

>>does it have pg kind of tags??
NOOO

jags
0
fargoCommented:
well, doesn't seem to fit then. If the pager taglib is set properly you should be getting some indication that it works. If the html page doesn't have pg tags, means the taglib is properly set. But then u should have a better working code.

Anyway, u r missing a closing tr after the head decleration (<tr><th>..</th></tr>)

0
jagadeesh_motamarriAuthor Commented:
check out my code

>>out.println("</tr>");
this actually closes the tr


what should i do now...
0
fargoCommented:
u r not closing the tr for th decleration. You are closing it for the data content. can you post ur html page?
0
jagadeesh_motamarriAuthor Commented:
sure.....here is my complete code....

<%@ page session="true" %>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="java.util.Vector.*" %>
<%@ page contentType="text/html;charset=ISO-8859-1" language="java" %>
<%@ taglib uri="/WEB-INF/jsp/pager-taglib.tld" prefix="pg" %>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html:html locale="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Home Page</title>

<!-- Style Sheet -->

<link  href="stylesheet.css" type="text/css" media="all" rel="stylesheet" />

<style type="text/css">
<!--
.style4 {
      font-size: 16px;
      font-weight: bold;
}
-->
</style>
</head>
<%

response.setHeader("Cache-Control","no-store"); //HTTP 1.1

response.setHeader("Pragma","no-cache"); //HTTP 1.0

response.setDateHeader ("Expires", 0); //prevents caching at the proxy server

%>
<%
       System.out.println("Now entered adminMain.jsp");
//       Vector err =(Vector)request.getAttribute("error");
       //get the request_auth count
       String req_count = (String)request.getAttribute("req_count")==null?"0":(String)request.getAttribute("req_count");
       request.setAttribute("req_count",req_count);

      
%>



<body>
 <pg:pager maxIndexPages="25" maxPageItems="20" export="currentPageNumber=pageNumber">
    <pg:param name="pg"/>
     <pg:param name="q"/>

<!-- Header logo-->
<table width="100%" border="0">
  <tr>
    <td width="8%" height="57" rowspan="3"><img src="images/Seal.gif" width="100" height="100" /></td>
    <td width="92%">&nbsp;      </td>
  </tr>
  <tr>
    <td height="10" style="font-family:arial;text-align:left;font-weight:bold;padding:3 0; margin-bottom:-1;"><span class="style4">Welcome to Department of US Army</span> </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

  <!-- Header logo ends here-->
<hr color="#D0B623" />
<table border="0" cellspacing="0" class="form-noindent">
  <tr>
    <td colspan="4" class="color_D0B623">&nbsp;</td>
  </tr>
  <tr>
    <td height="17" colspan="3" valign="top" class="color_D0B623">    </td>
    <td width="1073" rowspan="8" valign="top"><table width="100%" border="0" cellspacing="0">
      <tr>
        <td colspan="3">&nbsp;</td>
      </tr>
      <tr>
        <td width="2%" height="708">&nbsp;</td>
        <td width="96%" valign="top" ><div class="headings">
        <p>Suspense Tracking System Content </p>
        </div>
            
 
         
   
      
      

 
 
             
             <%
             System.out.println("Step - 1");
                  List searchMap = new ArrayList();
                  searchMap = (List)request.getAttribute("searchMap");
                  String tempData ="";
                  String tempData_Key = "";
                  
                  if(searchMap == null || searchMap.size() == 0){
                        String errmsg = "Currently are no Temporary Requests for C4iSR - Suspense Tracking System";
            %>
            
                  <h3 class="labeltxtb" align="center"><%out.write(errmsg);%></h3>
            <%}      else{ %>
                  
      
 
                  <table border="1" bordercolor="#D0B623" align="center" width="589" cellpadding="0" cellspacing="0" title="This table shows the results of the search query">
                  <tr class="labeltxtb">
                  <!-- Here Depending on the Option selected the sequence will be changed-->
                        <th>#</th>
                        <th>SID</th>
                        <th>Internal Due Date </th>
                        <th>Created Date </th>
                        <th>DO THIS</th>
                        
                <pg:item>  
                  <%
                  System.out.println("Step - 2");
                  
                  Iterator i = searchMap.iterator();
                  int j = 1;
      
                  
                  while(i.hasNext()){
                        Vector dataVector = (Vector)i.next();
                        if(dataVector !=null){
                        
                              int dataVectorSize = dataVector.size();
                              String id=dataVector.get(0).toString();
                              out.println("<tr>");
                        
                                    
                              out.println("<td class=\"labeltxt\" align=\"center\" >&nbsp;");
                              out.println(j);
                              out.println("&nbsp;</td>");
                              j++;
                              tempData_Key = dataVector.get(0)==null ?"" :dataVector.get(0).toString();
                              
                              for(int vectorIndex=1;vectorIndex<dataVectorSize;vectorIndex++){
                                    tempData = dataVector.get(vectorIndex)==null ?"" :dataVector.get(vectorIndex).toString();
                                    
                              
                                          
                                    out.println("<td class=\"labeltxt\" align=\"center\" >&nbsp;");
                                    out.println(tempData);
                                    out.println("&nbsp;</td>");
                                    
                                    
                              }// end of for loop
                              
                              
                              System.out.println("Key data: "+tempData_Key);
                              out.println("<td class=\"labeltxt\" align=\"center\" >&nbsp;");
                              out.println("<a href=\"deleteChief.jsp?cid=" + tempData_Key + "\" target=\"_self\" onclick=\"return confirmSubmit(this.form,'Are you sure you want to delete this chief?')\"><font color=\"red\">" + "Delete" + "</font></a>");
                              out.println("&nbsp;</td>");
                                    
                              
                        
                              out.println("</tr>");
                        
                        
                        }// end of if loop
                        else
                        out.println("Unable to retrieve the data properly. please contact system administrator");
                        
                        
                  }//end of while loop      
                              

                                          %>
                  </pg:item>
                        
                  </table>
                   <% }%>
            
             

<!-- this is for page indexing ** starts here -->
  <pg:index>
    <font face=Helvetica size=-1 color=ActiveCaption>Result Pages:
    <pg:prev>&nbsp;<a href="<%= pageUrl%>"  style="text-decoration:none">[&lt;&lt; Prev]</a></pg:prev>
    <pg:pages><%
      if (pageNumber.intValue() < 10) {
        %>&nbsp;<%
      }
      if (pageNumber == currentPageNumber) {
        %><b><%= pageNumber %></b><%
      } else {
        %><a href="<%= pageUrl%>"  style="text-decoration:none"><%= pageNumber %></a><%
      }
    %>
    </pg:pages>
    <pg:next>&nbsp;<a href="<%= pageUrl%>"  style="text-decoration:none">[Next &gt;&gt;]</a></pg:next>
    <br></font>
  </pg:index>
 
</pg:pager>
             
             
                      
             
             
             
             
             
             
              </td>
        <td width="2%">&nbsp;</td>
      </tr>
      <tr>
        <td height="16" colspan="3" valign="top">&nbsp;</td>
      </tr>
    </table>
      <p>&nbsp;</p>
    <p>&nbsp;</p></td>
  </tr>
  <tr>
    <td width="24" height="98" class="color_D0B623">&nbsp;</td>
    <td width="206" valign="top"><div id="navcontainer">
<ul id="navlist">
<li >
  <div align="center"><a href=adminMainHandler target="_self" >Home</a></div>
</li>
<li >
  <div align="center"><a href=ForwardToAddSuspense target="_self" >Add Suspense</a></div>
</li>
<li>
  <div align="center"><a href="#">Search Suspense</a></div>
</li>
<li>
  <div align="center"><a href="#">Generate Report</a></div>
</li>
<li>
  <div align="center"><a href="#">Change Profile</a></div>
</li>
</ul>
</div></td>
    <td width="24" height="98" class="color_D0B623">&nbsp;</td>
  </tr>
  <tr>
    <td height="18" colspan="3" class="color_D0B623">&nbsp;</td>
  </tr>
  <tr>
    <td width="24" height="98" class="color_D0B623">&nbsp;</td>
    <td width="206" valign="top"><div id="navcontainer">
<ul id="navlist">
<li >
  <div align="center"><a href=ShowReqListHandler target="_self" >Authentication Requests (<font color="#FF0000"><b> <% out.println(req_count);%></b></font> ) </a></div>
</li>
<li>
  <div align="center"><a href=ForwardToAddUser target="_self" >Add New User </a></div>
</li>        
<li>
  <div align="center"><a href=#" >Delete/Deactivate User </a></div>
</li>
<li>
  <div align="center"><a href=ShowUserListHandler target="_self" >View all Users </a></div>
</li>
</ul>
</div></td>
    <td width="24" height="98" class="color_D0B623">&nbsp;</td>
  </tr>
  <tr>
    <td height="17" colspan="3" class="color_D0B623">&nbsp;</td>
  </tr>
  <tr>
    <td width="24" height="71" class="color_D0B623">&nbsp;</td>
    <td width="206" valign="top"><div id="navcontainer">
<ul id="navlist">
<li >
  <div align="center"><a href=ForwardToAddChief target="_self" >Add Chief</a></div>
</li>
<li>
  <div align="center"><a href="#">Delete/Deactivate Chief</a></div>
</li>
<li>
  <div align="center"><a href=ShowChiefListHandler target="_self" >View all Chiefs </a></div>
</li>
</ul>
</div></td>
    <td width="24" height="71" class="color_D0B623">&nbsp;</td>
  </tr>
  <tr>
    <td height="17" colspan="3" class="color_D0B623">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3"><p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p></td>
  </tr>
</table>
<table width="100%" border="0">
  <tr>
    <td><div class="footer" >
        <div align="center">©2006 US Army -      <a href="#">Terms of Use</a> - <a href="#">Privacy Policy</a> </div>
      </div>&nbsp;</td>
  </tr>
</table><p>&nbsp; </p>
</body>
</html>


please help me with something....i'm in desparate need of this.

thank you,
Jags
0
fargoCommented:
can't understand much from your code. The only thing i see at the moment is

Use
<pg:pager maxIndexPages="25" maxPageItems="20" export="currentPageNumber=pageNumber">
    <pg:param name="pg"/>
     <pg:param name="q"/>
<table border="1" bordercolor="#D0B623" align="center" width="589" cellpadding="0" cellspacing="0" title="This table shows the results of the search query">
               <tr class="labeltxtb">
               <!-- Here Depending on the Option selected the sequence will be changed-->
                    <th>#</th>
                    <th>SID</th>
                    <th>Internal Due Date </th>
                    <th>Created Date </th>
                    <th>DO THIS</th>
                    </tr>                             // U R MISSING HERE
              <pg:item>
..............  

Can't u just test ur code by removing all the other code except the paginated table.
just above the table tag u r going to make paginated.
0
jagadeesh_motamarriAuthor Commented:
i tried ....but no luck...now i'm able to just see the result table...all the rows are getting displayed and i don't see the pagaination...

here is the code...i used now..

<%@ page session="true" %>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="java.util.Vector.*" %>
<%@ page contentType="text/html;charset=ISO-8859-1" language="java" %>
<%@ taglib uri="/WEB-INF/jsp/pager-taglib.tld" prefix="pg" %>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html:html locale="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Home Paqe</title>

<!-- Style Sheet -->

<link  href="stylesheet.css" type="text/css" media="all" rel="stylesheet" />

<style type="text/css">
<!--
.style4 {
      font-size: 16px;
      font-weight: bold;
}
-->
</style>
</head>
<%

response.setHeader("Cache-Control","no-store"); //HTTP 1.1

response.setHeader("Pragma","no-cache"); //HTTP 1.0

response.setDateHeader ("Expires", 0); //prevents caching at the proxy server

%>
<%
       System.out.println("Now entered adminMain.jsp");
//       Vector err =(Vector)request.getAttribute("error");
       //get the request_auth count
       String req_count = (String)request.getAttribute("req_count")==null?"0":(String)request.getAttribute("req_count");
       request.setAttribute("req_count",req_count);

      
%>



<body>
 <pg:pager maxIndexPages="25" maxPageItems="20" export="currentPageNumber=pageNumber">
    <pg:param name="pg"/>
     <pg:param name="q"/>

<!-- Header logo-->
<table width="100%" border="0">
  <tr>
    <td width="8%" height="57" rowspan="3"><img src="images/Seal.gif" width="100" height="100" /></td>
    <td width="92%">&nbsp;      </td>
  </tr>
  <tr>
    <td height="10" style="font-family:arial;text-align:left;font-weight:bold;padding:3 0; margin-bottom:-1;"><span class="style4">Welcome to Department of US Army</span> </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

  <!-- Header logo ends here-->
<hr color="#D0B623" />



 
 
             
             <%
             System.out.println("Step - 1");
                  List searchMap = new ArrayList();
                  searchMap = (List)request.getAttribute("searchMap");
                  String tempData ="";
                  String tempData_Key = "";
                  
                  if(searchMap == null || searchMap.size() == 0){
                        String errmsg = "Currently are no Temporary Requests for C4iSR - Suspense Tracking System";
            %>
            
                  <h3 class="labeltxtb" align="center"><%out.write(errmsg);%></h3>
            <%}      else{ %>
                  
      
 
                  <table border="1" bordercolor="#D0B623" align="center" width="589" cellpadding="0" cellspacing="0" title="This table shows the results of the search query">
                  <tr class="labeltxtb">
                  <!-- Here Depending on the Option selected the sequence will be changed-->
                        <th>#</th>
                        <th>SID</th>
                        <th>Internal Due Date </th>
                        <th>Created Date </th>
                        <th>DO THIS</th>
                  </tr>      
                <pg:item>  
                  <%
                  System.out.println("Step - 2");
                  
                  Iterator i = searchMap.iterator();
                  int j = 1;
      
                  
                  while(i.hasNext()){
                        Vector dataVector = (Vector)i.next();
                        if(dataVector !=null){
                        
                              int dataVectorSize = dataVector.size();
                              String id=dataVector.get(0).toString();
                              out.println("<tr>");
                        
                                    
                              out.println("<td class=\"labeltxt\" align=\"center\" >&nbsp;");
                              out.println(j);
                              out.println("&nbsp;</td>");
                              j++;
                              tempData_Key = dataVector.get(0)==null ?"" :dataVector.get(0).toString();
                              
                              for(int vectorIndex=1;vectorIndex<dataVectorSize;vectorIndex++){
                                    tempData = dataVector.get(vectorIndex)==null ?"" :dataVector.get(vectorIndex).toString();
                                    
                              
                                          
                                    out.println("<td class=\"labeltxt\" align=\"center\" >&nbsp;");
                                    out.println(tempData);
                                    out.println("&nbsp;</td>");
                                    
                                    
                              }// end of for loop
                              
                              
                              System.out.println("Key data: "+tempData_Key);
                              out.println("<td class=\"labeltxt\" align=\"center\" >&nbsp;");
                              out.println("<a href=\"deleteChief.jsp?cid=" + tempData_Key + "\" target=\"_self\" onclick=\"return confirmSubmit(this.form,'Are you sure you want to delete this chief?')\"><font color=\"red\">" + "Delete" + "</font></a>");
                              out.println("&nbsp;</td>");
                                    
                              
                        
                              out.println("</tr>");
                        
                        
                        }// end of if loop
                        else
                        out.println("Unable to retrieve the data properly. please contact system administrator");
                        
                        
                  }//end of while loop      
                              

                                          %>
                  </pg:item>
                        
                  </table>
                   <% }%>
            
             

<!-- this is for page indexing ** starts here -->
  <pg:index>
    <font face=Helvetica size=-1 color=ActiveCaption>Result Pages:
    <pg:prev>&nbsp;<a href="<%= pageUrl%>"  style="text-decoration:none">[&lt;&lt; Prev]</a></pg:prev>
    <pg:pages><%
      if (pageNumber.intValue() < 10) {
        %>&nbsp;<%
      }
      if (pageNumber == currentPageNumber) {
        %><b><%= pageNumber %></b><%
      } else {
        %><a href="<%= pageUrl%>"  style="text-decoration:none"><%= pageNumber %></a><%
      }
    %>
    </pg:pages>
    <pg:next>&nbsp;<a href="<%= pageUrl%>"  style="text-decoration:none">[Next &gt;&gt;]</a></pg:next>
    <br></font>
  </pg:index>
 
</pg:pager>
             
            
</body>
</html>


Jags
0
fargoCommented:
It looks fine to me. But in ur jsp, why r u using out.println to print the normal html tags??? why don't u directly use them. i mean instead of using

out.println("&nbsp;</td>");
use
</td>

0
jagadeesh_motamarriAuthor Commented:
becoz those rows are created dynamically i used ....out.println("&nbsp;</td>");

but i guess it shouldn't make any difference....!!


Jags
0
fargoCommented:
No idea. Could you please post the generated html from the jsp page (only having the paging table)
0
jagadeesh_motamarriAuthor Commented:
Well here is the HTML code that is generated from JSP...!!











<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html:html locale="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Welcome to Department of US Army - C4ISR</title>

<!-- Style Sheet -->

<link  href="stylesheet.css" type="text/css" media="all" rel="stylesheet" />

<style type="text/css">
<!--
.style4 {
      font-size: 16px;
      font-weight: bold;
}
-->
</style>
</head>





<body>
 
   
     

<!-- Header logo-->
<table width="100%" border="0">
  <tr>
    <td width="8%" height="57" rowspan="3"><img src="images/ArmySeal.gif" width="100" height="100" /></td>
    <td width="92%">&nbsp;      </td>
  </tr>
  <tr>
    <td height="10" style="font-family:arial;text-align:left;font-weight:bold;padding:3 0; margin-bottom:-1;"><span class="style4">Welcome to Department of US Army</span> </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

  <!-- Header logo ends here-->
<hr color="#D0B623" />



 
 
             
             
                  
      
 
                  <table border="1" bordercolor="#D0B623" align="center" width="589" cellpadding="0" cellspacing="0" title="This table shows the results of the search query">
                  <tr class="labeltxtb">
                  <!-- Here Depending on the Option selected the sequence will be changed-->
                        <th>#</th>
                        <th>SID</th>
                        <th>Internal Due Date </th>
                        <th>Created Date </th>
                        <th>DO THIS</th>
                  </tr>      
                   
                  <tr>
<td class="labeltxt" align="center" >&nbsp;
1
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asfdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=2" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
2
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=3" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
3
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
as
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=4" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
4
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
sadf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=5" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
5
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=6" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
6
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=7" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
7
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=8" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
8
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=9" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
9
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-6-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=10" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
10
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
aaaaaaaaaaaaaaa
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006 10:15:34 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=13" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
11
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
aaaaaaaaa
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006 10:19:17 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=14" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
12
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
aaaaa
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006 10:35:42 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=15" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
13
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
a
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006 10:50:23 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=16" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
14
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
aaaaa
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006 11:03:11 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=17" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
15
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
aa
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006 11:03:39 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=18" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
16
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
mmmmmmmm
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006 10:11:25 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=12" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
17
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
cool man
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-8-2006 10:05:38 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=11" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
18
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdfqqq123423
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 01:52:39 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=26" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
19
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
jagadeesh
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 11:55:09 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=27" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
20
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Vijay_kiran
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 01:33:58 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=31" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
21
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
etewrter
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 03:30:12 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=33" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
22
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
qwerqw
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 03:32:14 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=34" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
23
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
qwrqwe
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 03:35:00 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=35" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
24
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdfsa
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 03:40:53 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=37" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
25
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 06:35:43 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=38" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
26
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
a
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 12:21:07 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=19" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
27
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
q
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 12:23:03 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=20" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
28
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
werqwekoti
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 12:23:51 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=21" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
29
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
aaaaa
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 12:27:43 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=22" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
30
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
aaaaa
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 12:28:07 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=23" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
31
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
kiran
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 12:29:18 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=24" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
32
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Final Test Suspense Tracking System
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 01:36:33 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=25" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
33
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdfasdsadf_Rich
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 07:01:18 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=54" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
34
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
File Attachment
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 06:08:46 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=53" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
35
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdfasdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 05:54:12 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=51" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
36
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
First Suspense Tracking System
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 05:57:58 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=52" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
37
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
jagadeesh
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 04:47:34 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=49" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
38
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
vijay
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 05:15:34 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=50" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
39
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdfas
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 04:37:57 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=46" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
40
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdfas
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 04:41:29 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=47" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
41
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
kiran_kiran_vijay
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 04:35:32 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=45" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
42
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Our First Suspense
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 10:24:55 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=39" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
43
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Our First Suspense
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 10:25:50 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=40" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
44
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 03:58:54 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=41" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
45
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asfasdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 04:03:12 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=42" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
46
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asfasdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 04:03:44 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=43" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
47
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
kiran_vijay
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 04:33:48 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=44" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
48
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
jaga
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 07:36:55 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=55" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
49
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
kiran
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Aug-10-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-10-2006 04:44:44 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=48" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
50
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
akiran
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Sep-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 01:20:00 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=30" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
51
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
vijay
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Sep-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 03:38:27 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=36" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
52
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Oct-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=1" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
53
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
viajy
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Oct-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 12:29:09 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=28" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
54
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
sfasdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Oct-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 12:44:36 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=29" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
<tr>
<td class="labeltxt" align="center" >&nbsp;
55
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
kiran_kiran_vijay
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Nov-9-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-9-2006 02:06:51 PM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=32" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>

                  
                        
                  </table>
                    
            
             

<!-- this is for page indexing ** starts here -->
 
 
      
</body>
</html>
0
fargoCommented:
this is getting weird. Your table looks fine and even then there is no trace of pager taglib. Ok one last thing i would ask u is...do u have the pager-taglib.jar file in your WEB-INF/lib directory?

small thing (not related to this question), just use <html> at the start of ur page not <html:html..>(this is struts tag)
0
jagadeesh_motamarriAuthor Commented:
Yes i do i've it in ../lib

and even changed the html tag...still no luck.

0
fargoCommented:
i tested ur code and it works fine for me. Ok...i see why it is not working for you.

pg:item defines the row items for the pager tag. you have enclosed all the rows into pg:item instead of each row. You have to change as follows

<pg:item>
<tr>
<td>blah</td>....<td>blah</td>
</tr>
</pg:item>

each row (tr) should be enclosed with pg:item tag as shown above.


0
jagadeesh_motamarriAuthor Commented:
Thankz for your efforts fargo....but still no luck....

Anywayz i tried using my own logic to break it up into pages.....

Here is what i tried....


<form  method="post" action="adminMainHandler">



                        <input type="submit" value="<<" <%=(thePage>1)?"":"DISABLED"%> onClick="return pageChange(this.form,1)">

                        <input type="submit" value="<" <%=(thePage>1)?"":"DISABLED"%> onClick="return pageChange(this.form,<%=thePage-1%>)">                        

                        <input type="text" size="1" maxlength="9" value = "<%=thePage%>" name="page">      

                        <strong>of <%=totalPages%></strong>

                        <input type="submit" value=">" <%=(thePage<totalPages)?"":"DISABLED"%> onClick="return pageChange(this.form,<%=thePage+1%>)">

                        <input type="submit" value=">>" <%=(thePage<totalPages)?"":"DISABLED"%> onClick="return pageChange(this.form,<%=totalPages%>)">                        

                        <input type=hidden name="lastVisitedPage" value="articleList">                        

                        <input type=hidden name="articleCount" value="<%=articleCount%>">            



          </form>      

...................it working coooll and fast...but only disadvantage is its making query to the database whenever i press a button..i don't know if its the same with jsp tags

Thankz
0
fargoCommented:
with jsp tags it's not making query on every page link. But i tried ur code and it works very fine for me. You can see the code below. The approach you are using is good when u have very mass data. Moreover u can also make use of database pagination like in mysql use LIMIT clause and in Oracle use rownum handling.

take the below code. Paste it to some test.jsp and do change the pager-taglib reference in the directive and test it..it works fine. You can compare it with the code u generated with your jsp. u should enclose your each tr or each row inside pg:item tag.

<%@ page contentType="text/html;charset=ISO-8859-1" language="java" %>
<%@ taglib uri="/WEB-INF/pager-taglib.tld" prefix="pg" %>
<html:html locale="true">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Welcome to Department of US Army - C4ISR</title>

<!-- Style Sheet -->

<link  href="stylesheet.css" type="text/css" media="all" rel="stylesheet" />

<style type="text/css">
<!--
.style4 {
     font-size: 16px;
     font-weight: bold;
}
-->
</style>
</head>
<body>
<!-- Header logo-->
<table width="100%" border="0">
  <tr>
    <td width="8%" height="57" rowspan="3"><img src="images/ArmySeal.gif" width="100" height="100" /></td>
    <td width="92%">&nbsp;     </td>
  </tr>
  <tr>
    <td height="10" style="font-family:arial;text-align:left;font-weight:bold;padding:3 0; margin-bottom:-1;"><span class="style4">Welcome to Department of US Army</span> </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

  <!-- Header logo ends here-->
<hr color="#D0B623" />
<!-- Making use of page tag library -->
<pg:pager maxIndexPages="25" maxPageItems="3" export="currentPageNumber=pageNumber">
  <pg:param name="pg"/>
  <pg:param name="q"/>
      <center>
               <table border="1" bordercolor="#D0B623" align="center" width="589" cellpadding="0" cellspacing="0" title="This table shows the results of the search query">
               <tr class="labeltxtb">
               <!-- Here Depending on the Option selected the sequence will be changed-->
                    <th>#</th>
                    <th>SID</th>
                    <th>Internal Due Date </th>
                    <th>Created Date </th>
                    <th>DO THIS</th>
               </tr>    
                 
<pg:item>
<tr>
<td class="labeltxt" align="center" >&nbsp;
1
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asfdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=2" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
</pg:item>
<pg:item>
<tr>
<td class="labeltxt" align="center" >&nbsp;
1
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asfdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=2" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
</pg:item>
<pg:item>
<tr>
<td class="labeltxt" align="center" >&nbsp;
1
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asfdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=2" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
</pg:item>
<pg:item>
<tr>
<td class="labeltxt" align="center" >&nbsp;
1
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asfdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=2" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
</pg:item>
<pg:item>
<tr>
<td class="labeltxt" align="center" >&nbsp;
1
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asfdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=2" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
</pg:item>
<pg:item>
<tr>
<td class="labeltxt" align="center" >&nbsp;
1
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asfdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=2" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
</pg:item>
<pg:item>
<tr>
<td class="labeltxt" align="center" >&nbsp;
1
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asfdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=2" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
</pg:item>
<pg:item>
<tr>
<td class="labeltxt" align="center" >&nbsp;
1
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
asfdf
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
Apr-5-2006 12:00:00 AM
&nbsp;</td>
<td class="labeltxt" align="center" >&nbsp;
<a href="deleteChief.jsp?cid=2" target="_self" onclick="return confirmSubmit(this.form,'Are you sure you want to delete this chief?')"><font color="red">Delete</font></a>
&nbsp;</td>
</tr>
</pg:item>
</table>
<!-- this is for page indexing ** starts here**-->
  <pg:index>
    <font face=Helvetica size=-1 color=ActiveCaption>Result Pages:
    <pg:prev>&nbsp;<a href="<%= pageUrl%>" style="text-decoration:none">[&lt;&lt; Prev]</a></pg:prev>
    <pg:pages><%
      if (pageNumber.intValue() < 10) {
        %>&nbsp;<%
      }
      if (pageNumber == currentPageNumber) {
        %><b><%= pageNumber %></b><%
      } else {
        %><a href="<%= pageUrl%>" style="text-decoration:none"><%= pageNumber %></a><%
      }
    %>
    </pg:pages>
    <pg:next>&nbsp;<a href="<%= pageUrl%>" style="text-decoration:none">[Next &gt;&gt;]</a></pg:next>
    <br></font>
  </pg:index>
</pg:pager>
</body>
</html>

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jagadeesh_motamarriAuthor Commented:
Hi Fargo,

Thankz.... Thankz alot for all your efforts. It works fine with me too..I had a deadline the other day so just carried away with the other idea i posted earlier. ofcourse since the database i'm using is MYSQL, i used the LIMIT keyword to do pagination.

Anywayz thatz a grt8 help and effort. I learned something new to implement. May be i can be able to implement it in my future projects or might add this feature as an upgrade.

-----
Jags
0
fargoCommented:
perfect.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.