<%
@ page language
=
"
java
"
import
=
"
java.util.*
"
pageEncoding
=
"
GB2312
"
%>
<%
@ taglib uri
=
"
http://jsptags.com/tags/navigation/pager
"
prefix
=
"
pg
"
%>
<%
request.setCharacterEncoding(
"
GB2312
"
);
%>
<
jsp:useBean id
=
"
pm
"
scope
=
"
page
"
class
=
"
net.jf.ajax.business.PageManager
"
/>
<!
DOCTYPE HTML PUBLIC
"
-//W3C//DTD HTML 4.01 Transitional//EN
"
>
<
html
>
<
head
>
</
head
>
<
body
>
<
form name
=
"
cc
"
action
=
"
page1.jsp
"
method
=
"
post
"
>
<
input type
=
"
text
"
name
=
"
name
"
value
=
"
<%=request.getParameter(
"
name
"
)%>
"
/>
<
input type
=
"
submit
"
value
=
"
search
"
/>
</
form
>
<
pg:pager
items
=
"
<%= pm.getSize(request.getParameter(
"
name
"
)) %>
"
index
=
"
center
"
maxPageItems
=
"
3
"
maxIndexPages
=
"
0
"
scope
=
"
request
"
>
<%
int
pageNum
=
1
;
if
(request.getParameter(
"
pageNo
"
)
!=
null
)
pageNum
=
Integer.valueOf(request.getParameter(
"
pageNo
"
));
int
pageSize
=
3
;
List result
=
pm.query(pageNum,pageSize,request.getParameter(
"
name
"
));
%>
<
table border
=
"
1
"
>
<
tr
>
<
td
>
result
</
td
>
</
tr
>
<%
for
(
int
i
=
0
; i
<
result.size(); i
++
) {
%>
<
tr
>
<
td
>
<%=
result.get(i)
%>
</
td
>
</
tr
>
<%
}
%>
</
table
>
<
pg:param name
=
"
name
"
/>
<
pg:index
>
<
jsp:include page
=
"
jsptags.jsp
"
flush
=
"
true
"
/>
</
pg:index
>
</
pg:pager
>
</
body
>
</
html
>
<%
@ page language
=
"
java
"
import
=
"
java.util.*
"
pageEncoding
=
"
GB2312
"
%>
<%
@ taglib uri
=
"
http://jsptags.com/tags/navigation/pager
"
prefix
=
"
pg
"
%>
<
pg:first
>
<
a href
=
"
<%=pageUrl %>&pageNo=<%=pageNumber%>
"
><
nobr
>
[ #
<%=
pageNumber
%>
首页 ]
</
nobr
></
a
>
</
pg:first
>
<
pg:skip pages
=
"
<%= -5 %>
"
>
<
a href
=
"
<%=pageUrl%>&pageNo=<%=pageNumber%>
"
><
nobr
>
[ #
<%=
pageNumber
%>
后退 ]
</
nobr
></
a
>
</
pg:skip
>
<
pg:prev
>
<
a href
=
"
<%=pageUrl%>&pageNo=<%=pageNumber%>
"
><
nobr
>
[ #
<%=
pageNumber
%>
前一页 ]
</
nobr
></
a
>
</
pg:prev
>
<
pg:pages
>
<
a href
=
"
<%=pageUrl%>&pageNo=<%=pageNumber%>
"
><%=
pageNumber
%></
a
>
</
pg:pages
>
<
pg:next
>
<
a href
=
"
<%=pageUrl%>&pageNo=<%=pageNumber%>
"
><
nobr
>
[ 下一页 #
<%=
pageNumber
%>
]
</
nobr
></
a
>
</
pg:next
>
<
pg:skip pages
=
"
<%=5%>
"
>
<
a href
=
"
<%=pageUrl%>&pageNo=<%=pageNumber%>
"
><
nobr
>
[ 跳进 #
<%=
pageNumber
%>
]
</
nobr
></
a
>
</
pg:skip
>
<
pg:last
>
<
a href
=
"
<%=pageUrl%>&pageNo=<%=pageNumber%>
"
><
nobr
>
[ 尾页 #
<%=
pageNumber
%>
]
</
nobr
></
a
>
</
pg:last
>