Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
XPage.java
Package: (J2EE)oa.rar [view]
Upload User: lm2018
Upload Date: 2015-12-12
Package Size: 30449k
Code Size: 2k
Category:
Jsp/Servlet
Development Platform:
Java
- package com.oa.util;
- import java.util.List;
- public class XPage {
- private int currentPage;
- private int count;
- private String path;
- private int allCount;
- private List list;
- public int getAllCount() {
- return allCount;
- }
- public void setAllCount(int allCount) {
- this.allCount = allCount;
- }
- public int getCount() {
- return count;
- }
- public void setCount(int count) {
- this.count = count;
- }
- public int getCurrentPage() {
- return currentPage;
- }
- public void setCurrentPage(int currentPage) {
- this.currentPage = currentPage;
- }
- public List getList() {
- return list;
- }
- public void setList(List list) {
- this.list = list;
- }
- public String getPath() {
- return path;
- }
- public void setPath(String path) {
- this.path = path;
- }
- public int getAllPage(){
- return (this.allCount-1)/this.count+1;
- }
- public String getPageBar(){
- StringBuffer bar = new StringBuffer();
- bar.append("<%@ page language='java' pageEncoding='UTF-8'%>");
- bar.append("<div class='tableHead'><span align="left" style='margin-left:10px'>当前"+this.currentPage+"/"+this.getAllPage()+"共"+this.allCount+"条记录</span>");
- bar.append("<span align=right style='margin-right:10px;margin-left:100px'>");
- if(this.currentPage<=1){
- bar.append("首页 上页 ");
- }else{
- bar.append("<a href=""+path+"currentPage=1">首页</a> ");
- bar.append("<a href=""+path+"currentPage="+(this.currentPage-1)+"">上页</a> ");
- }
- if(this.currentPage>=this.getAllPage()){
- bar.append("下页 尾页");
- }else{
- bar.append("<a href=""+path+"currentPage="+(this.currentPage+1)+"">下页</a> ");
- bar.append("<a href=""+path+"currentPage="+(this.getAllPage())+"">尾页</a>");
- }
- bar.append("<select style='width:35' name="xx" onchange="forward(this.value)">");
- for(int i=1;i<=this.getAllPage();i++){
- if(i==this.currentPage){
- bar.append("<option value='"+i+"' selected>"+i+"</option>");
- }else{
- bar.append("<option value='"+i+"'>"+i+"</option>");
- }
- }
- bar.append("</select></span></div>");
- bar.append("<script>");
- bar.append("function forward(page){")
- .append(" location.href='"+path+"currentPage='+page;")
- .append("}");
- bar.append("</script>");
- return bar.toString();
- }
- }