Hi All,
Am using
jsp pagination tags to display the no of employees in the jsp page.When the page loading initially it is displaying records correctly with specified nof records,also no of pages and all.But when am moving for next set of records am getting error because of NULL value for deptno.('deptno' comes from the previous page from request scope, from 2nd time onwards it is becoming NULL)
Please help out how can i make that deptno not to be null .
also is there any anthor approch for pagination
following jsp code am using for dispalying the employee records
<%@ page session="false" %>
<jsp

irective.page import="java.util.List,com.emp.*"/>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<html:html>
<body bgcolor="#ffffff">
<%
int maxPageItems = 4;
%>
<form action="<%= request.getRequestURI() %>" method="post">
<pg

ager
items="<%=siz %>"
maxPageItems="<%=maxPageItems %>"
isOffset="<%= true %>"
export="offset,currentPageNumber=pageNumber"
scope="request">
<pg

aram name="maxPageItems"/>
<pg

aram name="maxIndexPages"/>
<%-- save pager offset during form changes --%>
<input type="hidden" name="pager.offset" value="<%= offset %>">
<table width="90%" cellspacing="1" cellpadding="1" border="1">
<tr bgcolor="#6b97e7" style="color:white;font-weight:bold;font-size:12px;">
<td width="30%">Employee Id</td>
<td width="30%">Employee Name</td>
<td width="30%">Employee Salary</td>
</tr>
<%
Employee e=null;
String deptno=(String)request.getParameter("DepartNo")
//Code to retrive the emplyees based on DepartNo
//List li storing in List
siz=li.size();
for (int i = offset.intValue(),
l = Math.min(i +maxPageItems, li.size());
i < l; i++)
{
e=(Employee)li.get(i);
%>
<pg:item>
<tr>
<td><a href=""><%= e.getEmpId() %></a></td>
<td> <%= e.getEmpName() %></td>
<td> <%= e.getEmpSal() %></td>
</tr>
</pg:item>
<%} %>
</table>
<pg:index>
<jsp:include page="/WEB-INF/jsp/altavista.jsp" flush="true"/>
</pg:index>
</pg

ager>
</body>
</html:html>
<%!
private static int siz=0;
%>