<% @ Page language = "java" import = "java. util. *" pageEncoding = "UTF-8" %>
<% @ Page import = "datedao. UserBase"
%>
<% @ Page import = "datedao. DateDao"
%>
<! Doctype html public "-// W3C // dtd html 4.01 Transitional // EN">
<Script type = "text/javascript" language = "JavaScript">
<! --
Function Jumping (){
Form1.action = "/fenye/display. jsp ";
Form1.submit ();
Return;
}
// -->
</Script>
<Html>
<Head>
<Title> My JSP 'display. jsp 'starting page </title>
<Meta http-equiv = "pragma" content = "no-cache">
<Meta http-equiv = "cache-control" content = "no-cache">
<Meta http-equiv = "expires" content = "0">
<Meta http-equiv = "keywords" content = "keyword1, keyword2, keyword3">
<Meta http-equiv = "description" content = "This is my page">
<! --
<Link rel = "stylesheet" type = "text/css" href = "styles.css">
-->
</Head>
<Body>
<FORM align = center name = "form1">
<TABLE border = 1> <TR> <td> name </td> <td> password </td> </TR>
<%
Int topage = 1 ;//
Int nowpage ;//
Int rowInPage = 3 ;//
Int allrow ;//
Int pages ;//
Topage = Integer. parseInt (request. getParameter ("topage "));
If (topage <1)
Topage = 1;
DateDao uu = new DateDao ();
ArrayList as = new ArrayList ();
As = uu. getDate ();
Allrow = as. size ();
Pages = (allrow % 3 = 0? (Pages = allrow/3) :( pages = (allrow/3 + 1 )));
For (int I = 0; I <3; I ++ ){
If (topage-1) * 3 + I) <allrow ){
UserBase ub = (UserBase) as. get (topage-1) * 3 + I );
%>
<TR> <td> <% = ub. getUserName () %> </td> <% = ub. getUserPassWord () %> </td> </TR>
<%}
Else break;
}
%>
<TR> <td> <a href = "/fenye/display. jsp? Topage = topage-1 %> "> pre </td> <a href ="/fenye/display. jsp? Topage = <% = topage + 1%> "> next </td> </TR>
</TABLE>
Turn to <SELECT name = "topage" onchange = "Jumping ()">
<%
For (int I = 1; I <= pages; I ++ ){
If (I = topage ){
%>
<OPTION selected value = <% = I %> </OPTION>
<%} Else {%>
<OPTION value = <% = I %> </OPTION>
<% }}%>
</SELECT>
</FORM>
</Body>
</Html>