JSP分组分页
来源:互联网 发布:来电管家软件 编辑:程序博客网 时间:2024/05/18 03:08
<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@page import="com.pp.ee.util.AnalysisPageXml"%>
<%@page import="com.pp.page.tagsstips.AllMainTagsBean"%>
<%@page import="com.ppaxtie.page.tagsstips.ProductHeadTagsBean"%>
<%@page import="com.pp.ee.directory.products.CompanyBean"%>
<%@page import="com.pp.ee.directory.company.CompanyService"%>
<%@page import="java.util.*"%>
<%
CompanyService CompanyService1=new CompanyService();
String userType="u2";
int currPage=Integer.parseInt((request.getParameter("currPage")==null)? "1" :request.getParameter("currPage"));//定义分页的默认页为第一页
int pageSize=2;//每页显示多少行
int rowCount=CompanyService1.getAllNum(userType);//一共有多少记录
int pageCount=(rowCount%pageSize==0)? (rowCount/pageSize):((rowCount/pageSize)+1);//共有多少页
String language=(request.getParameter("language")==null)?"ch":request.getParameter("language");
AnalysisPageXml AnalysisPageXml=new AnalysisPageXml();
AllMainTagsBean AllMainTagsBean=(AllMainTagsBean)AnalysisPageXml.getPageTips("AllMainTags",language);
ProductHeadTagsBean ProductHeadTagsBean=(ProductHeadTagsBean)AnalysisPageXml.getPageTips("producthead",language);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><%=AllMainTagsBean.getInternationalDevelopmentDirectory()%></title>
<meta name="generator" content="maxtie" />
<meta name="description" content="<%=AllMainTagsBean.getDescription() %>"/>
<meta name="keywords" content="<%=AllMainTagsBean.getTitlekeyword() %>"/>
<link rel="stylesheet" type="text/css" href="freindlyLInk/css/cooperator.css" />
<script>
function serchPage(){
var tt=document.getElementById("currPage").value;
if(isNaN(tt))
{
alert("对不起,请您输入数字......");
document.getElementById("currPage").value="";
return;
}
var page=parseInt(tt);
if(page<=<%=pageCount%>){
document.form.submit();
}else
{
alert("对不起,您输入的数字过大......");
document.getElementById("currPage").value="";
return;
}
}
</script>
</head>
<body
<table border="0" cellpadding="0" cellspacing="0" align="center" class="SubNav">
<tr>
</tr>
</table>
<div id="title">
<h3><%=AllMainTagsBean.getVipMembers()%></h3></div>
<table id="topTable" cellpadding="0" cellspacing="0">
<%
CompanyService CompanyService=new CompanyService();
List list=CompanyService.getAll(userType,language,currPage,pageSize);
for(int i=0;i<list.size();i++){
CompanyBean CompanyBean=(CompanyBean)list.get(i);
if(i%2==0){
%>
<tr><td><img src="<%=request.getContextPath()%>/images<%=CompanyBean.getLogPath()%>" alt="logo" width="166" height="54" />
<div><a href="../dircetory/company/Comapny_data/<%=CompanyBean.getCompanyid()%>_<%=language %>.html"><%=CompanyBean.getCompanyname() %></a>
<p><%=AllMainTagsBean.getRegion() %>:<%=CompanyBean.getCompanystate() %></p>
<p><%=AllMainTagsBean.getIndustry() %>:<%=CompanyBean.getCompanyindustry() %></p>
</div>
</td>
<%
}else{
%>
<td><img src="<%=request.getContextPath()%>/images<%=CompanyBean.getLogPath()%>" alt="logo" width="166" height="54" />
<div><a href="../dircetory/company/Comapny_data/<%=CompanyBean.getCompanyid()%>_<%=language %>.html"><%=CompanyBean.getCompanyname() %></a>
<p><%=AllMainTagsBean.getRegion() %>:<%=CompanyBean.getCompanystate() %></p>
<p><%=AllMainTagsBean.getIndustry() %>:<%=CompanyBean.getCompanyindustry() %></p>
</div>
</td>
</tr>
<%
}
}
%>
</table>
<table width="800" height="17" border="0" cellspacing="0" cellpadding="0" style=" margin:5px auto;">
<tr>
<td align="center" width="550" valign="bottom"><a href="zhou.jsp?currPage=1&language=<%=language%>"><img src="ChangePage/First_Btn.jpg" alt=" " width="49" height="17" style="margin-right:5px;"/></a>
<%
int GcurrPage=0;
int GpageSize=5;//每列显示5页
int GpageCount=(pageCount%GpageSize==0)? (pageCount/GpageSize):((pageCount/GpageSize)+1);//共有多少列
%>
<%
if(currPage>1){
%>
<a href="zhou.jsp?currPage=<%=currPage-1%>&language=<%=language%>"><img src="ChangePage/Previous_Btn.jpg" alt=" " width="53" height="17" style="margin-right:5px;"/></a>
<%
}%>
<%
for(int i=1;i<=GpageCount;i++){
if((i-1)*GpageSize<currPage&&currPage<=i*GpageSize){
GcurrPage=i;
if(GcurrPage>1){
%>
<a href="zhou.jsp?currPage=<%=(GcurrPage-1)*GpageSize%>&language=<%=language %>">...</a>
<%
}
if(i*GpageSize<pageCount){
for(int j=(i-1)*GpageSize+1;j<=i*GpageSize;j++){
%>
<a id="b<%=j%>" href="zhou.jsp?currPage=<%=j%>&language=<%=language %>"><%=j%></a>
<%
if(j==currPage){%>
<script>
document.getElementById("b<%=j%>").className="hoverpage";
</script>
<%}
}
}else{
for(int j=(i-1)*GpageSize+1;j<=pageCount;j++){
%>
<a id="b<%=j%>" href="zhou.jsp?currPage=<%=j%>&language=<%=language %>"><%=j%></a>
<%
if(j==currPage){%>
<script>
document.getElementById("b<%=j%>").className="hoverpage";
</script>
<%}
}
}
if(GcurrPage<GpageCount){%>
<a href="zhou.jsp?currPage=<%=GcurrPage*GpageSize+1%>&language=<%=language %>">...</a>
<% }
}
}
%>
<%if(currPage<pageCount){ %>
<a href="zhou.jsp?currPage=<%=currPage+1%>&language=<%=language%>"><img src="ChangePage/Next_Btn.jpg" alt=" " width="53" height="17" style="margin-right:5px;"/></a>
<% }%>
<a href="zhou.jsp?currPage=<%=pageCount%>&language=<%=language%>" ><img src="ChangePage/Last_Btn.jpg" alt=" " width="54" height="17" style="margin-right:5px;"/></a>
</td>
<td valign="top" style="font-size:14px; color:red;">[ <%= currPage%>/<%=pageCount%> ] </td>
<td>
<form name="form" action="zhou.jsp" method="post">
<input type="text" id="currPage" name="currPage" size="1" style="width:20px; height:15px;float:left;margin-right:5px;"/><img src="ChangePage/Go_Btn.jpg" onclick="serchPage()" style="float:left;"/>
</form>
</td>
</tr>
</table>
</body>
</html>
- JSP分组分页
- mysql分组分页
- jsp分页
- JSP分页
- Jsp分页
- jsp分页
- jsp分页
- JSP分页
- jsp 分页
- jsp分页
- jsp分页
- JSP分页
- JSP分页
- jsp分页
- jsp分页
- JSP 分页
- jsp分页
- Jsp分页
- 关闭页面时,写入日志的问题
- system.exe,weiai.exe,alitao32.exe,wd1123.dll,ProtectorA.sys等
- 划定一块区域,对其进行操作
- Unit 和 Int转换 Unit转Int Int转Unit
- 刀根さん、御光臨を歓迎します。
- JSP分组分页
- VC2005中提示"生成cmd.exe时出错"的解决方法
- 无法加载安装程序库 wbemupgd.dll,或是找不到函数 OcEntry。请与您的系统管理员联系。特定错误码是 0x7e
- Galbanum之Ioc(一)
- Effective Java(2nd Edition) Item 57 仅为例外条件使用异常(译文)
- excel列显示列号
- 大学毕业十年后
- 动态批量初始化CLOB字段
- 多变的微软