<% @ Page Language = "Java" Import = "Java. util. *" pageencoding = "UTF-8" %>
<% @ Page import = "com. modorn. Bean. userdao" %>
<% @ Page import = "com. modorn. Bean. userbean" %>
<%
String Path = request. getcontextpath ();
String basepath = request. getscheme () + "://"
+ Request. getservername () + ":" + request. getserverport ()
+ Path + "/";
%>
<! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">
<HTML>
<Head>
<Base href = "<% = basepath %>">
<Title> my JSP 'manger. 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">
-->
<Style type = "text/CSS">
Table {border-collapse: collapse ;}
TD {border: # CCC solid 1px; padding: 5px ;}
</Style>
</Head>
<Body>
<%! Int pagenow = 1; %>
<%
String username = (string) request. getsession (). getattribute ("username ");
If (username = NULL ){
Response. sendredirect ("login. jsp? Erro = 1 ");
}
If (request. getparameter ("pagenow ")! = NULL ){
Pagenow = integer. parseint (request. getparameter ("pagenow "));
}
%>
<Center>
Welcome
<Font color = Red> <% = username %> </font> log on
<Br/>
<Br/> will military training last very dark for 10 days?
<Br/>
<%
Userdao = new userdao ();
Int pagenum = userdao. getpagenum ();
Arraylist <userbean> List = userdao. fenyeinfo (pagenow );
Int countpage = userdao. getcounpage ();
%>
<Table width = "100%" border = "0" cellspacing = "0" cellpadding = "0">
<Tr>
<TH>
User ID
</Th>
<TH>
User Name
</Th>
<TH>
Password
</Th>
<TH>
User Type
</Th>
</Tr>
<%
For (INT I = 0; I <list. Size (); I ++ ){
Out. println ("<tr> <TD>" + list. Get (I). getuserid () + "</TD> ");
Out. println ("<TD>" + list. Get (I). GetUserName () + "</TD> ");
Out. println ("<TD>" + list. Get (I). getpassw () + "</TD> ");
Out. println ("<TD>" + list. Get (I). getgrade () + "</TD> </tr> ");
}
%>
</Table>
<! -- Paging Algorithm Start -->
<%
If (pagenow! = 1 ){
Out. println ("<a href = manger. jsp? Pagenow = "+ (pagenow-1)
+ "> Previous page </a> ");
}
Int start;
If (pagenow <pagenum ){
Start = 1;
} Else {
Start = pagenow-10 + 1;
}
For (INT I = start; I <= countpage & I <= pagenow + pagenum; I ++ ){
If (I = pagenow ){
Out. println (I); what can be used to remove black circles
Continue;
}
Out. println ("<a href = manger. jsp? Pagenow = "+ I +"> ["+ I
+ "] </A> ");
}
If (pagenow! = Countpage ){
Out. println ("<a href = manger. jsp? Pagenow = "+ (pagenow + 1)
+ "> Next page </a> ");
}
%>
<! -- End of paging algorithm -->
</Center>
</Body>
</Html>