JSP实现留言板的JavaBean类和分页显示的源码(3) return this.memoVector;
}
}///以下是网页源码<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><%@ page language="java" import="java.util.*" %><%@ page import="java.text.*" %><%@ page import="userinfobean.*" %><jsp:useBean id="memoInfo" scope="page" class="userinfobean.memoBean"/><jsp:useBean id="memoQuery" scope="page" class="userinfobean.databaseBean"/><%!int totalPages;int countPerPage=3;int totalCount;int currentPage=0;int currentStart;%><%memoQuery.dbQueryMemos();Vector vt=memoQuery.getMemoVector();totalCount=vt.size();totalPages=totalCount/countPerPage;if(totalCount%countPerPage>0)totalPages=totalPages+1;if(request.getParameter("page")==null){currentPage=1;}else{currentPage=Integer.parseInt(request.getParameter("page"));if(currentPage>totalPages)currentPage=totalPages;if(currentPage<1)currentPage=1;}currentStart=totalCount-1-countPerPage * (currentPage-1);%><html><head><title>NetGreen</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <link rel="stylesheet" href="main.CSS技巧">CSS"> </head><script language="JavaScript" >function page_check(){if(document.pageForm.page.value==""){alert("请输入页数");document.pageForm.page.focus();return false;}return true;}</script><body bgcolor="ffffff" >
<center> <table width="800" border="0" height="622">