⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 background.jsp

📁 新闻系统
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<link rel="stylesheet" href="css/style.css">
<%@ page import="java.util.List"%>
<%@ page import="com.actionForm.NewsForm"%>
<jsp:useBean id="time" scope="request" class="com.tool.TimeShow"/>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>宇晨网络新闻中心后台首页</title>
</head>

<%
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;
  }
%>

<body><div align="center">
<jsp:include page="bTop.jsp"/>
<table width="800" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="196" rowspan="2" valign="top"><jsp:include page="bleft.jsp"/></td>
    <td width="600" height="57" background="bImage/place.jpg" ><table width="600" height="36" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td>&nbsp;&nbsp;当前位置提示&nbsp;&gt;&gt;&nbsp;后台首页</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table></td>
  </tr>
  <tr align="center">
    <td valign="top" background="bImage/big.jpg" >	  <table width="601" border="0" cellpadding="0" cellspacing="0" background="bImage/placeNext.jpg">
        <tr>
          <td height="21" >&nbsp;</td>
          <td>全部新闻查询</td>
        </tr>
      </table>
	  <br>

	  <table width="500" border="1" cellpadding="0" cellspacing="0">
      <tr>
        <td width="54" height="27"><div align="center">编号</div></td>
        <td width="145"><div align="center">题目</div></td>
        <td width="78"><div align="center">类别</div></td>
        <td width="78"><div align="center">创建时间</div></td>
        <td width="126"><div align="center">操作</div></td>
      </tr>
	     <%
  for(int i=start;i<over;i++){
  NewsForm form=(NewsForm)list.get(i);
  %>
      <tr>
        <td width="54" height="31"><div align="center"><%=i+1%></div></td>
        <td width="145"><div align="center"><%=form.getTitle()%></div></td>
        <td width="85"><div align="center"><%=form.getBigSort()%></div></td>
        <td width="78"><div align="center">
          <%if(time.cuttentMonthDate().equals(form.getCreateTime())){%>
          <b><font color="#0265CB">NEW</font></b>
<%}else{%><%=form.getCreateTime()%><%}%>
</div></td>
        <td width="126"><div align="center"><a href="newsAction.do?method=selectOneNewsAction&id=<%=form.getId()%>">查询详细内容</a></div></td>
      </tr>
	  <%}%>
    </table>

	<table width="95%" border="0" cellpadding="0" cellspacing="0">
      <tr align="center">
        <td width="578" height="32" >
          <%for(int i=0;i<pageNumber;i++){%>
          <%if(count==i){%>
          [<font color="#FF0000"><b><%=i+1%></b></font>]
          <%}else{%>
      [<a href="newsAction.do?method=selectNewsAction&count=<%=i%>"><b><%=i+1%></b></a>]
      <%}}%></td>
      </tr>
    </table></td>
  </tr>
</table>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -