日期:2014-05-18  浏览次数:20747 次

pager-taglib分页 求救!!!
用pager-taglib 做jsp分页,在第一次收到从action来的结果集,正常。换页后就不显示了,应该是结果集超出了范围,不知为什么?请教各位,先谢谢了。
相关代码片断如下:

action里传结果集的:
Session session = SessionFactory.getSession();
Transaction tx = session.beginTransaction();
Query q = session.createQuery("from Student as s where s.name='"
+ csForm.getSname() + "'" + " and s.entertime >= "+ dtime + " and s.entertime <= " + ntime);
List lq = q.list();
if(lq.isEmpty()){
errors.add("error.findnull", new ActionError("error.findnull"));
saveErrors(request, errors);
return mapping.findForward("error");
}
request.setAttribute("sid", sid);
request.setAttribute("SLIST", lq);//重点在这儿

return new ActionForward("/list.jsp");

jsp部分:



<pg:pager url="slist.do" maxPageItems="4" maxIndexPages="3"
  export="currentPageNumber=pageNumber" >
<table width="95%" cellspacing="1" cellpadding="0" align="center">
<tr class="tdheader">
<th width="10%" align="center">&nbsp;
</th>

<th width="10%" align="center">
学号
</th>
<th width="10%" align="center">
姓名
</th>
<th width="10%" align="center">
性别
</th>
<th width="10%" align="center">
年龄
</th>
<th width="10%" align="center">
所在班级
</th>
<th width="10%" align="center">
入学时间
</th>
<th width="15%" align="center">
家庭住址
</th>
<th width="15%" align="center">
联系电话
</th>
</tr>
<c:forEach var='sd' items="${SLIST}">
<pg:item>

<tr>
<td width="10%">&nbsp;
</td>

<td width="10%">
<font color="#008200"><c:out value='${sd.studentnumber}' /> </font>
</td>
<td width="10%">
<font color="#008200"><c:out value='${sd.name}' /> </font>
</td>
<td width="10%">
<font color="#008200"> <c:out value='${sd.sex}' /></font>
</td>
<td width="10%">
<font color="#008200"><c:out value='${sd.age}' /> </font>
</td>
<td width="10%">
<font color="#008200"><c:out value='${sd.studentclass}' /> </font>
</td>
<td width="10%">
<%
/*
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date d = sd.getEntertime();
String ss ="";
if(null != d){
StringBuffer sb = new StringBuffer();
sdf.format(d,sb,new FieldPosition(0));
ss =(sb.toString());
}
*/

%>
<font color="#008200">&nbsp; </font>
</td>
<td width="15%">
<font color="#008200"><c:out value='${sd.address}' /> </font>
</td>
<td width="