details

<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%@ page import="bysj.Dao.*"%>
<%@ page import="bysj.Entity.*"%>
<%!int newid=0; %>
<%!int index=0; %>
<%
request.setCharacterEncoding("gbk");
NewsDao newsdao = new NewsDao();
//int index=0;
int prep=0;
int next=0;
if(request.getParameter("newsID")!=null){
newid=Integer.parseInt(request.getParameter("newsID"));
}else{
prep=index;
next=index;
if(request.getParameter("index")!=null){
boolean isnull=false;
for(int i=0;i<NewsDao.newslist.size();i++)
{
if(newid==(Integer)NewsDao.newslist.get(i)){
index=i+1;
isnull=true;
newid=0;
//out.print("<script>alert('"+newid+isnull+index+"')</script>");
}
//out.print("<script>alert('"+newid+" "+i+"')</script>");
}
//out.print("<script>alert('"+newid+isnull+index+"')</script>");
if(isnull==false){
index=Integer.parseInt(request.getParameter("index"));
}
}
if(index>=1){
prep=index-1;
}
if(index<=NewsDao.newslist.size()-1){
next=index+1;
}
if(index==0){
index=NewsDao.newslist.size()-1;
}
if(index==NewsDao.newslist.size()){
index=0;
}
newid=(Integer)NewsDao.newslist.get(index);
}
News news=(News)newsdao.findNewsByID(newid);
//int newsID = news.getNewsID();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>新闻信息页面</title>
<style>
.font{font-size=14px;
font-weight:bold}
.border{background-color:#FFF5FA}
</style>
<link rel="stylesheet" type="text/css" href="css/right.css">
</head>

<body>
<%@ include file="top.jsp"%>
<table border="0" align="center" width="799" class="border">
<tr>
<td colspan="2">
<a href="index.jsp">首页</a>><a href="showNewsList.jsp">站内新闻</a>
</td>
</tr>
<tr>
<td>
<%@ include file="left.jsp"%>
</td>
<td valign="top">
<table border="0" width="589">
<tr style="background-image:url('image/cg2.jpg'); " height="50">
<td colspan="2" align="center" class="font">
<%=news.getTitle()%> </td>
</tr>
<tr>
<td width="500" rowspan="2">
<%=news.getContent()%> </td>
<td> </td>
</tr>
<tr>
<td>
<img src="image/n10.jpg"></img> </td>
</tr>
<tr>
<td align="right">
<a href="detailNews.jsp?index=<%=prep %>">上一条</a>|<a href="detailNews.jsp?index=<%=next %>">下一条</a> </td>
<td align="center">
<%=news.getWriterDate()%> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
<%@ include file="bottom.jsp"%>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值