这个是DAO,原本是从数据库查询数据的,不过我填充了假数据,不受影响的!package com.xxx.dao;import java.util.ArrayList;
import java.util.List;import com.xxx.entity.Archive;public class ArchiveListDAO {
public List<Archive> findAll(){

Archive archive1 = new Archive();
List<Archive> list = new ArrayList<Archive>();
archive1.setDocMgrName("牛二");
archive1.setDepartmentName("管理处");
archive1.setCatchNum(1005);
archive1.setArchiveNum(1001);
archive1.setLastOpeTime("2012年4月27日");
list.add(archive1);

Archive archive2 = new Archive();
archive2.setDocMgrName("牛二");
archive2.setDepartmentName("管理处");
archive2.setCatchNum(1005);
archive2.setArchiveNum(1001);
archive2.setLastOpeTime("2012年4月27日");
list.add(archive2);

Archive archive3 = new Archive();
archive3.setDocMgrName("牛二");
archive3.setDepartmentName("管理处");
archive3.setCatchNum(1005);
archive3.setArchiveNum(1001);
archive3.setLastOpeTime("2012年4月27日");
list.add(archive3);

Archive archive4 = new Archive();
archive4.setDocMgrName("牛二");
archive4.setDepartmentName("管理处");
archive4.setCatchNum(1005);
archive4.setArchiveNum(1001);
archive4.setLastOpeTime("2012年4月27日");
list.add(archive4);

Archive archive5 = new Archive();
archive5.setDocMgrName("牛二");
archive5.setDepartmentName("管理处");
archive5.setCatchNum(1005);
archive5.setArchiveNum(1001);
archive5.setLastOpeTime("2012年4月27日");
list.add(archive5);

return list;
}
}
这个是Action类:package com.xxx.action;import java.util.List;import com.docworks.dao.ArchiveListDAO;
import com.docworks.entity.Archive;public class ArchiveListAction {
private List<Archive> archive; public String execute(){
ArchiveListDAO arcListDAO = new ArchiveListDAO();
try{
archive = arcListDAO.findAll();
System.out.println(archive);
return "success";
}catch(Exception e){
e.printStackTrace();
return "error";
}
} public List<Archive> getArchive() {
return archive;
} public void setArchive(List<Archive> archive) {
this.archive = archive;
}
}
这个是JSP页面要显示的信息: <div id="left">
<div id="left_1">
<div id=left_b1>
<img src="images/m1.jpg" width="88" height="34" />
</div>
<!--归档情况开始-->
<div id=left_n1>
<table width="99%" border="0" align="center" cellpadding="0"
cellspacing="0">
<tr>
<td class="table1">
档案员名称
</td>
<td class="table1">
部门名称
</td>
<td class="table1">
捕获数量
</td>
<td class="table1">
归档数量
</td>
<td class="table1">
最后操作时间
</td>
</tr>
<!--归档情况叠代开始-->
<s:iterator value="archive">
<tr>
<td class="table2">
<img src="images/icon2.gif" hspace="4" />
<s:property value="docMgrName"/>
</td>
<td class="table2">
<s:property value="departmentName"/>
</td>
<td class="table2">
<s:property value="catchNum"/>
</td>
<td class="table2">
<s:property value="archiveNum"/>
</td>
<td class="table2">
<s:property value="lastOpeTime"/>
</td>
</tr>
</s:iterator>
<!--归档情况叠代结束-->
<tr>
<td colspan="5" class="table4">
<!--归档情况分页开始-->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left">
<table width="240" border="0" cellspacing="0"
cellpadding="0">
<form id="form2" name="form2" method="post" action="">
<tr>
<td width="20">
&nbsp;
</td>
<td width="20" align="center">
<img src="images/first.jpg" width="10" height="9" />
</td>
<td width="20" align="center">
<img src="images/up.jpg" width="5" height="9" />
</td>
<td width="10" align="center">
<img src="images/shu.jpg" width="1" height="16" />
</td>
<td width="20" align="center">

</td>
<td width="40" align="center">
<input name="textfield2" type="text" class="input2" />
</td>
<td width="30" align="center">
/1
</td>
<td width="10" align="center">
<img src="images/shu.jpg" width="1" height="16" />
</td>
<td width="20" align="center">
<img src="images/down.jpg" width="5" height="9" />
</td>
<td width="20" align="center">
<img src="images/last.jpg" width="10" height="9" />
</td>
<td width="10" align="center">
<img src="images/shu.jpg" width="1" height="16" />
</td>
<td width="20" align="center">
<img src="images/sx.jpg" width="11" height="12" />
</td>
</tr>
</form>
</table>
</td>
<td width="25%" align="center">
显示1-5条,共5条
</td>
</tr>
</table>
<!--归档情况分页结束-->
</td>
</tr>
</table>
</div>
<!--归档情况结束-->
</div>
现在要让数据显示到JPS页面的时候是分页显示的,每页显示3个条目,要怎样实现?