?? selectbigsort.jsp
字號:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="newsDao" scope="request" class="com.dao.NewsDao"/>
<%@ page import="com.actionForm.NewsForm"%>
<%@ page import="java.util.List"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<jsp:useBean id="sortDao" scope="request" class="com.dao.SortDao"/>
<jsp:useBean id="time" scope="request" class="com.tool.TimeShow"/>
<jsp:useBean id="chinese" scope="request" class="com.tool.Chinese"/>
<title>宇晨網絡新聞中心前臺--新聞類別查詢</title>
</head>
<link rel="stylesheet" href="css/style.css">
<body><div align="center">
<jsp:include page="../fTop.jsp" />
<%
String bigSort=chinese.toChinese(request.getParameter("bigSort"));
List list=(List)request.getAttribute("list");
int number=list.size();
//以下這段代碼是計算多少頁數
int pageNumber=number;
if(pageNumber%11==0){
pageNumber=pageNumber/11;
}else{
pageNumber=pageNumber/11+1;
}
//以下是計算當前頁的頁數
int count;
if(request.getParameter("count")==null){
count=0;
}else{
count=Integer.valueOf(request.getParameter("count"));
}
//以下顯示多少條紀錄
int start=count*11;//開始條數
int over=(count+1)*11;//結束條數
int lastCount=number-over;//還剩多少條記錄
if(lastCount<=0){
over=number;
}
%>
<table width="800" height="660" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="216" rowspan="3" valign="top"><jsp:include page="../fleft.jsp"/></td>
<td height="31" colspan="2" align="left" valign="middle" background="fImage/place.jpg" > 當前位置 >> <%=bigSort%></td>
</tr>
<tr>
<td height="31" colspan="2" align="center" valign="middle" background="fImage/newsSort.jpg"><font color="#FFFFFF"><%=bigSort%></font> </td>
</tr>
<tr>
<td width="160" height="598" align="center" valign="top" ><br> <table width="102" height="107" cellpadding="0" cellspacing="0">
<tr>
<td background="fImage/<%=request.getParameter("image")%>.jpg"> </td>
</tr>
</table></td>
<td width="424" align="left" valign="top" background="fImage/fbottem.jpg">
<br> <%if(number==0){%>
<font size="+3" color="#CC3333"><b>暫——無</b></font>
<%}else{%>
<%
for(int i=start;i<over;i++){
NewsForm form=(NewsForm)list.get(i);
%>
<table width="404" cellpadding="0" cellspacing="0">
<tr>
<td width="20" height="20" ><img src="fImage/triangle.jpg" width="6" height="9"></td>
<td width="100"><a href="newsAction.do?method=frontSelectOneAction&id=<%=form.getId()%>"><%=form.getTitle()%></a></td>
<td width="116"><a href="newsAction.do?method=frontSelectSmallSortAction&sortId=<%=form.getSortId()%>&bigSort=<%=bigSort%>&image=<%=request.getParameter("image")%>"><b>[<%=sortDao.selectSortName(form.getSortId())%>]</b></a></td>
<td width="154"> <%if(form.getCreateTime().equals(time.cuttentMonthDate())){%>
<img src="fImage/new.gif"><%}else{%>
<%=form.getCreateTime()%>
<%}%></td>
</tr>
</table>
<table width="404" height="5" cellpadding="0" cellspacing="0">
<tr>
<td height="15"><hr></td>
</tr>
</table>
<%}%>
<table width="87%" border="0" cellpadding="0" cellspacing="0">
<tr align="center">
<td width="578" height="37" >
<%for(int i=0;i<pageNumber;i++){%>
<%if(count==i){%>
[<font color="#FF0000"><b><%=i+1%></b></font>]
<%}else{%>
[<a href="newsAction.do?method=frontSelectBigSortAction&bigSort=<%=bigSort%>&count=<%=i%>"><b><%=i+1%></b></a>]
<%}}%></td>
</tr>
</table>
<%}%>
</td>
</tr>
</table>
<jsp:include page="../fBottom.jsp"/>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -