求页面分页代码(hibernate-3.1.3)
<%@page contentType="text/html;charset=gb2312"%>
<%@include file="public.jsp"%>
<%
//参数说明
//数据查询条件,值域:timeout/allorder
String condition=getString(request,"condition","allorder");
%>
<%
ObjectSession objectSession=null;
List list_data=null;
new ObjectSessionFactory().close();
try{
objectSession = new ObjectSessionFactory().open();
list_data=objectSession.find("from User");
}catch(Exception e){
System.out.println(e);
}
%>
<style type="text/css">
<!--
.style5 {font-size: 13px; }
-->
</style>
<table width="97%" height="22%" border="0" >
<tr height="8%" >
<th width="10%"scope="col"><div align="left"><a href="./user_list.jsp">人员信息</a></div></th>
<th width="10%"scope="col"><div align="left"><a href="#" onclick="parent.detailFrame.location.replace('./user_new.jsp')">新增人员</a></div></th>
<th width="11%"scope="col"><a href="./group_list.jsp">群组信息</a></th>
<th width="11%"scope="col"><a href="#" onclick="parent.detailFrame.location.replace('./group_new.jsp')">新增群组</a></th>
<th width="12%"scope="col"> </th>
<th width="9%"scope="col"> </th>
<th width="9%"scope="col"> </th>
<th width="9%"scope="col"> </th>
<th width="9%"scope="col"> </th>
</tr>
<tr>
<th height="88" colspan="10" scope="row"><table width="100%" border="0" cellspacing="1" bgcolor="#666666">
<tr bgcolor="#CCCCCC">
<th width="122" height="16" scope="col"> <div align="left" class="style5">
<div align="center">姓名</div>
</div></th>
<th width="131" scope="col"><div align="left" class="style5">
<div align="center">用户</div>
</div></th>
<th width="105" scope="col"><div align="left" class="style5">
<div align="center">群组</div>
</div></th>
<th width="149" scope="col"><div align="left" class="style5">
<div align="center">手机号码</div>
</div></th>
<th width="115" scope="col"><div align="left" class="style5">邮件地址</div></th>
<th width="177" scope="col">
<div align="center" class="style5">
操作
</div></th>
</tr>
<%
for(int i=0;list_data!=null&&i<list_data.size();i++){
User user=(User)list_data.get(i);
Iterator it=null;
try{
Set groupSet=user.getGroups();
it=groupSet.iterator();
}catch(Exception e){
it=null;
}
String groupInfo="";
for(int k=0;it!=null&&it.hasNext();){
groupInfo+=" "+((Group)it.next()).getName();
}
%>
<tr bgcolor="#FFFFFF">
<th scope="row"><div align="left"><%=getISO8859(user.getName())%></div></th>
<td><div align="left"><%=getISO8859(user.getUsername())%></div></td>
<td><%=getISO8859(groupInfo)%></td>
<td><%=getISO8859(user.getMobileTel())%></td>
<td><%=getISO8859(user.getEmail())%></td>
<td class="style5"><a href="#" onclick="parent.detailFrame.location.replace(this.url)" url="detailForm.jsp?id=<%=user.getForm().getId()%>">查看明细</a></td>
</tr>
<%}%>
</table></th>
</tr>
</table>