一共有8条记录,第一次查询时显示分成两页:点击下一页却显示无记录:可是我传了参数啊!代码如下:
<!--主页面-->
<html:form action="stu.do">
<html:hidden property="operate" value="searchByClass"/>
<table id="main"><tr><td colspan="3">
  学生成绩录入<br />
  -------------------</tr><tr>
  <td>系别:
  <html:select property="department" style="height: 22; width: 80">
<option value="计算机">计算机</option>
     <option value="会计">会计</option>
  </html:select>
  
  </td><td>班级:  
    <html:select property="classes" style="height: 22; width: 80">
<option value="1班">1班</option>
     <option value="2班">2班</option>
    </html:select>
  
  </td><td>
<html:submit>查询</html:submit>
</td></tr>
</table>
</html:form>----------------------------------------------------------------------------------
<table border="0" cellPadding="0" cellSpacing="0" width="100%">
             <logic:present name="pageresult" scope="request">
<!-- 翻页信息 -->
<script language="javascript">
function pagesubmit(pageno){
        document.all.${pageresult.pageBean.p_Form}1.${pageresult.pageBean.p_PAGE}.value=pageno;
document.all.${pageresult.pageBean.p_Form}1.submit();
 }
</script>
                  <form name="${pageresult.pageBean.p_Form}1" mothed="post" action="stu.do">
                  <input type="hidden" name="department" value="${department}">
                  <input type="hidden" name="classes" value="${classes}">                   
                  </form>
  
           <!-- 学生列表 -->                        
                          
                          <logic:present name="pageresult" scope="request">
<logic:notEmpty name="pageresult" property="resultList">
                  <logic:iterate name="pageresult" property="resultList" id="stu" indexId="index">
                        <bean:define id="indexrow" value="${index%2}"></bean:define>
                        <logic:equal value="0" name="indexrow">
                       
                        </logic:equal>
                        <logic:equal value="1" name="indexrow">
                        </logic:equal>

<bean:write name="stu" property="usernum"/>
<bean:write name="stu" property="username"/>
<bean:write name="stu" property="sex" /> <br />


</logic:iterate>
</logic:notEmpty>
<logic:empty name="pageresult" property="resultList">

没有学生信息

                        </logic:empty>
</logic:present>
                          
                          
                          
<!-- 翻页信息 -->
<script language="javascript">
 function pagesubmit(pageno){
 document.all.${pageresult.pageBean.p_Form}2.${pageresult.pageBean.p_PAGE}.value=pageno;
document.all.${pageresult.pageBean.p_Form}2.submit(); }
 </script>
                  <form name="${pageresult.pageBean.p_Form}2" mothed="post" action="stu.do">
                  <input type="hidden" name="operate" value="searchByClass" />
                  <input type="hidden" name="department" value="${department}">
                  <input type="hidden" name="classes" value="${classes}">
                          <jsp:include flush="true" page="/pageinfo.jsp"/>
                  </form>
                          </logic:present>
</table><!-- 分页信息显示页面 pageinfo.jsp--><%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"
prefix="bean"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html"
prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<!-- 判断是否有分页结果 -->
<logic:present name="pageresult" scope="request">
<!-- 得到总页数 -->
<bean:define id="ipageCount" value="${pageresult.pageBean.pageCount}" />
<!-- 得到当前页数 -->
<bean:define id="ipage" value="${pageresult.pageBean.page}" />
<!-- 总记录数 -->
<html:hidden property="${pageresult.pageBean.p_COUNT}"
value="${pageresult.pageBean.count}" />
<!-- 每页记录数 -->
<html:hidden property="${pageresult.pageBean.p_PAGESIZE}"
value="${pageresult.pageBean.pageSize}" />
<!-- 总页数 -->
<html:hidden property="${pageresult.pageBean.p_PAGECOUNT}"
value="${pageresult.pageBean.pageCount}" />
<!-- 当前页数 -->
<html:hidden property="${pageresult.pageBean.p_PAGE}"
value="${pageresult.pageBean.page}" />
<tr height="26">
<td background="images/m_center_toolbar_bk.jpg">
<table border="0" cellPadding="0" cellSpacing="0" width="100%">
<tr>
<td width="15"></td>
<td align="right"><font class="font12"> 
<!-- 显示第几页与总页数 -->
第<bean:write name="pageresult" property="pageBean.page" />/<bean:write
name="pageresult" property="pageBean.pageCount" />页 | 
<logic:notEqual value="1" name="pageresult" property="pageBean.page">
<a href="#" onclick="javascript:pagesubmit(1);return false;">首页</a>
    </logic:notEqual>
    <logic:equal value="1" name="pageresult" property="pageBean.page">首页</logic:equal>
| <logic:greaterThan value="1" name="pageresult" property="pageBean.page">
<a href="#" onclick="javascript:pagesubmit(${pageresult.pageBean.page-1});return false;">前页</a>
</logic:greaterThan> 
<logic:lessThan value="2" name="pageresult" property="pageBean.page">前页</logic:lessThan> | 
<logic:lessThan value="${pageresult.pageBean.pageCount}" name="pageresult" property="pageBean.page">
<a href="#" onclick="javacript:pagesubmit(${pageresult.pageBean.page+1});return false;">后页</a>
</logic:lessThan> 
<logic:greaterThan value="${pageresult.pageBean.pageCount-1}" name="pageresult" property="pageBean.page">后页</logic:greaterThan> |
<logic:notEqual value="${pageresult.pageBean.pageCount}" name="pageresult" property="pageBean.page">
<a href="#" onclick="javacript:pagesubmit(${pageresult.pageBean.pageCount});return false;">尾页</a>
</logic:notEqual> 
<logic:equal value="${pageresult.pageBean.pageCount}" name="pageresult" property="pageBean.page">
尾页
</logic:equal> | 
转<select
name="selpage" onchange="javascript:pagesubmit(selpage.value);">
<%
//得到当前页数
int itpage = (new Integer(ipage)).intValue();
//循环显示所有页数,并把当前页数标记为选中
for (int i = 1; i <= (new Integer(ipageCount)).intValue(); i++) {
%>
<option value="<%=i%>" <%=(itpage==i)?" selected":"" %>><%=i%></option>
<%
}
%>
</select>页 </font></td>
</tr>
</table>
</td>
</tr>
</logic:present>