📄 index.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="java.util.List"%>
<%@ page import="com.actionForm.NewsForm"%>
<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"/>
<title>宇晨网络新闻中心前台首页</title>
</head>
<link rel="stylesheet" href="css/style.css">
<body><div align="center">
<jsp:include page="fTop.jsp" flush="true"/>
<table width="800" height="678" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="216" rowspan="3" valign="top"><jsp:include page="fleft.jsp"/></td>
<td height="216" valign="middle">
<table width="584" height="224" border="0" cellpadding="0" cellspacing="0" background="fImage/rightOne.jpg">
<tr>
<td height="44"><table width="262" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="131" height="18"> </td>
<td width="134"><div align="right" class="word_white"><strong><a href="newsAction.do?method=frontSelectBigSortAction&bigSort=时政要闻&image=politics"><font color="#FFFFFF">more...</font></a></strong></div></td>
</tr>
</table></td>
<td height="44"><table width="262" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="131" height="18"> </td>
<td width="134"><div align="right" ><strong><a href="newsAction.do?method=frontSelectBigSortAction&bigSort=经济动向&image=economy"><font color="#FFFFFF">more...</font></a></strong></div></td>
</tr>
</table></td>
</tr>
<tr>
<td width="291" valign="top">
<%
List polityList=newsDao.selectNews("时政要闻");
int polityNumber=polityList.size();
if(polityNumber>5){polityNumber=5;}
%> <%if(polityNumber==0){%><div align="center"><br>暂无</div><%}else{%>
<br> <table width="234" border="0" align="center" cellpadding="0" cellspacing="0">
<%
for(int polity=0;polity<polityNumber;polity++){
NewsForm polityForm=(NewsForm)polityList.get(polity);
%>
<%
String title=polityForm.getTitle();
if(title.length()>7){
title=title.substring(0,7)+"...";
}
%>
<tr >
<td width="77" height="25"><strong><a href="newsAction.do?method=frontSelectSmallSortAction&sortId=<%=polityForm.getSortId()%>&bigSort=<%=polityForm.getBigSort()%>&image=politics">[<%=sortDao.selectSortName(polityForm.getSortId())%>]</a></strong></td>
<td width="115"><a href="newsAction.do?method=frontSelectOneAction&id=<%=polityForm.getId()%>"><%=title%></a></td>
<td width="42">
<%if(polityForm.getCreateTime().equals(time.cuttentMonthDate())){%>
<img src="fImage/new.gif"><%}else{%>
<%=polityForm.getCreateTime()%>
<%}%>
</td>
</tr>
<%}%>
</table>
<%}%></td>
<td width="291" valign="top">
<%
List economyList=newsDao.selectNews("经济动向");
int economyNumber=economyList.size();
if(economyNumber>5){economyNumber=5;}
%>
<%if(economyNumber==0){%><div align="center"><br>暂无</div><%}else{%>
<br><table width="234" border="0" align="center" cellpadding="0" cellspacing="0">
<%
for(int economy=0;economy<economyNumber;economy++){
NewsForm economyForm=(NewsForm)economyList.get(economy);
%>
<%
String title=economyForm.getTitle();
if(title.length()>7){
title=title.substring(0,7)+"...";
}
%>
<tr >
<td width="77" height="25"><strong><a href="newsAction.do?method=frontSelectSmallSortAction&sortId=<%=economyForm.getSortId()%>&bigSort=<%=economyForm.getBigSort()%>&image=economy">[<%=sortDao.selectSortName(economyForm.getSortId())%>]</a></strong></td>
<td width="115"><a href="newsAction.do?method=frontSelectOneAction&id=<%=economyForm.getId()%>"><%=title%></a></td>
<td width="42">
<%if(economyForm.getCreateTime().equals(time.cuttentMonthDate())){%>
<img src="fImage/new.gif"><%}else{%>
<%=economyForm.getCreateTime()%>
<%}%>
</td>
</tr>
<%}%>
</table><%}%><br></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="222">
<table width="584" height="226" border="0" cellpadding="0" cellspacing="0" background="fImage/rightTwo.jpg">
<tr>
<td height="44"><table width="262" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="131" height="18"> </td>
<td width="134"><div align="right"><strong><a href="newsAction.do?method=frontSelectBigSortAction&bigSort=法制教育&image=law"><font color="#FFFFFF">more...</font></a></strong></div></td>
</tr>
</table></td>
<td height="44"><table width="262" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="131" height="18"> </td>
<td width="134"><div align="right"><strong><a href="newsAction.do?method=frontSelectBigSortAction&bigSort=科学教育&image=science"><font color="#FFFFFF">more...</font></a></strong></div></td>
</tr>
</table></td>
</tr>
<tr>
<td width="293" valign="top">
<%
List lawList=newsDao.selectNews("法制教育");
int lawNumber=lawList.size();
if(lawNumber>5){lawNumber=5;}
%>
<%if(lawNumber==0){%><div align="center"><br>暂无</div><%}else{%>
<br> <table width="234" border="0" align="center" cellpadding="0" cellspacing="0">
<%
for(int law=0;law<lawNumber;law++){
NewsForm lawForm=(NewsForm)lawList.get(law);
%>
<%
String title=lawForm.getTitle();
if(title.length()>7){
title=title.substring(0,7)+"...";
}
%>
<tr >
<td width="77" height="25"><strong><a href="newsAction.do?method=frontSelectSmallSortAction&sortId=<%=lawForm.getSortId()%>&bigSort=<%=lawForm.getBigSort()%>&image=law">[<%=sortDao.selectSortName(lawForm.getSortId())%>]</a></strong></td>
<td width="115"><a href="newsAction.do?method=frontSelectOneAction&id=<%=lawForm.getId()%>"><%=title%></a></td>
<td width="42">
<%if(lawForm.getCreateTime().equals(time.cuttentMonthDate())){%>
<img src="fImage/new.gif"><%}else{%>
<%=lawForm.getCreateTime()%>
<%}%>
</td>
</tr>
<%}%>
</table>
<%}%><br></td>
<td width="296" valign="top">
<%
List scienceList=newsDao.selectNews("科学教育");
int scienceNumber=scienceList.size();
if(scienceNumber>5){scienceNumber=5;}
%>
<%if(scienceNumber==0){%><div align="center"><br>暂无</div><%}else{%>
<br> <table width="234" border="0" align="center" cellpadding="0" cellspacing="0">
<%
for(int science=0;science<scienceNumber;science++){
NewsForm scienceForm=(NewsForm)scienceList.get(science);
%>
<tr >
<td width="77" height="25"><strong><a href="newsAction.do?method=frontSelectSmallSortAction&sortId=<%=scienceForm.getSortId()%>&bigSort=<%=scienceForm.getBigSort()%>&image=science">[<%=sortDao.selectSortName(scienceForm.getSortId())%>]</a></strong></td>
<td width="115"><a href="newsAction.do?method=frontSelectOneAction&id=<%=scienceForm.getId()%>"><%=scienceForm.getTitle()%></a></td>
<td width="42">
<%if(scienceForm.getCreateTime().equals(time.cuttentMonthDate())){%>
<img src="fImage/new.gif"><%}else{%>
<%=scienceForm.getCreateTime()%>
<%}%>
</td>
</tr>
<%}%>
</table>
<%}%>
<br></td>
</tr>
</table></td>
</tr>
<tr>
<td height="225">
<table width="584" height="228" border="0" cellpadding="0" cellspacing="0" background="fImage/rightThree.jpg">
<tr>
<td height="42"><table width="262" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="131" height="23"> </td>
<td width="134"><div align="right"><strong><a href="newsAction.do?method=frontSelectBigSortAction&bigSort=社会现象&image=society"><font color="#FFFFFF">more...</font></a></strong></div></td>
</tr>
</table></td>
<td height="42"><table width="262" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="131" height="18"> </td>
<td width="134"><div align="right"><strong><a href="newsAction.do?method=frontSelectBigSortAction&bigSort=娱乐天地&image=fun"><font color="#FFFFFF">more...</font></a></strong></div></td>
</tr>
</table></td>
</tr>
<tr>
<td width="293" valign="top">
<%
List societyList=newsDao.selectNews("社会现象");
int societyNumber=societyList.size();
if(societyNumber>5){societyNumber=5;}
%>
<%if(societyNumber==0){%><div align="center"><br>暂无</div><%}else{%>
<br>
<table width="234" border="0" align="center" cellpadding="0" cellspacing="0">
<%
for(int society=0;society<societyNumber;society++){
NewsForm societyForm=(NewsForm)societyList.get(society);
%>
<%
String title=societyForm.getTitle();
if(title.length()>7){
title=title.substring(0,7)+"...";
}
%>
<tr >
<td width="77" height="25"><strong><a href="newsAction.do?method=frontSelectSmallSortAction&sortId=<%=societyForm.getSortId()%>&bigSort=<%=societyForm.getBigSort()%>&image=society">[<%=sortDao.selectSortName(societyForm.getSortId())%>]</a></strong></td>
<td width="115"><a href="newsAction.do?method=frontSelectOneAction&id=<%=societyForm.getId()%>"><%=title%></a></td>
<td width="42">
<%if(societyForm.getCreateTime().equals(time.cuttentMonthDate())){%>
<img src="fImage/new.gif"></font><%}else{%>
<%=societyForm.getCreateTime()%>
<%}%>
</td>
</tr>
<%}%>
</table>
<%}%>
<br><br><br></td>
<td valign="top">
<%
List funList=newsDao.selectNews("娱乐天地");
int funNumber=funList.size();
if(funNumber>5){funNumber=5;}
%>
<%if(funNumber==0){%><div align="center"><br>暂无</div><%}else{%>
<br> <table width="234" border="0" align="center" cellpadding="0" cellspacing="0">
<%
for(int fun=0;fun<funNumber;fun++){
NewsForm funForm=(NewsForm)funList.get(fun);
%>
<%
String title=funForm.getTitle();
if(title.length()>7){
title=title.substring(0,7)+"...";
}
%>
<tr >
<td width="77" height="25"><strong><a href="newsAction.do?method=frontSelectSmallSortAction&sortId=<%=funForm.getSortId()%>&bigSort=<%=funForm.getBigSort()%>&image=fun">[<%=sortDao.selectSortName(funForm.getSortId())%>]</a></strong></td>
<td width="115"><a href="newsAction.do?method=frontSelectOneAction&id=<%=funForm.getId()%>"><%=title%></a></td>
<td width="42">
<%if(funForm.getCreateTime().equals(time.cuttentMonthDate())){%>
<img src="fImage/new.gif"><%}else{%>
<%=funForm.getCreateTime()%>
<%}%>
</td>
</tr>
<%}%>
</table>
<%}%>
<br> <br><br></td>
</tr>
</table>
</td>
</tr>
</table>
<jsp:include page="fBottom.jsp"/>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -