- <%@page contentType="text/html; charset=GBK" language="java" %>
- <%@page import="com.mycompany.news.service.NewsService"%>
- <%@page import="com.mycompany.news.dao.impl.*"%>
- <%@page import="com.mycompany.news.dto.*"%>
- <%@page import="java.text.SimpleDateFormat"%>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <link href="./css/common.css" rel="stylesheet" type="text/css">
- <meta http-equiv="Content-Type" content="text/html; charset=gbk">
- <title>新闻信息</title>
- </head>
- <%
- Long id=Long.valueOf(request.getParameter("id"));
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
- NewsService service = new NewsService();
- service.setNewsDAO(new NewsDAOImpl());
- News news = service.getByID(id.longValue());
- java.util.List attachments = service.getAttachments(id.longValue());
- %>
- <body leftmargin="40" bgcolor="#FAFAFA" background="./images/line.gif">
- <table align="center" border=0 width="90%" cellpadding=0 cellspacing=20 bgcolor=#EFEFEF>
- <TR>
- <TD bgColor=#000000 height=1></TD>
- </TR>
- <tr>
- <td width="90%">
- <table width="100%" background="./images/left1.gif">
- <tr>
- <td align="center">
- <font size='4'>
- <b><%=news.getSubject()%>(访问次数 <%=service .getVisitCount(id.longValue())%>)</b>
- </font>
- </td>
- </tr>
- <tr>
- <td align="right" >
- <font size='3'>
- <b>作者(<%=news.getAuthor()%>)-- <%=sdf.format(news.getShowTime())%></b>
- </font>
- </td>
- </tr>
- </table>
- </tr>
- <TR>
- <TD bgColor=#000000 height=1 width="60%"></TD>
- </TR>
- <tr>
- <td colspan='4' align="left" bgColor="#CCCCCC">
- <%=news.getContent()%>
- </td>
- </tr>
- <%for(int i=0;i<attachments.size();i++){
- NewsAttachment attachment = (NewsAttachment )attachments.get(i);
- if(service.isImage(attachment)){
- %>
- <tr>
- <td align="right"><%=attachment.getAttachmentName()%>
- <a href="<%=request.getContextPath()%>/servlet/download?id=<%=attachment.getAttachmentId()%>">
- <image border="0" width="200" height="100" src="<%=request.getContextPath()%>/servlet/download?id=<%=attachment.getAttachmentId()%>">
- </a>
- </td>
- </tr>
- <%
- }
- %>
- <%}%>
- <%for(int i=0;i<attachments.size();i++){
- NewsAttachment attachment = (NewsAttachment )attachments.get(i);
- if(!service.isImage(attachment)){
- %>
- <tr>
- <td align="right"><a href="<%=request.getContextPath()%>/servlet/download?id=<%=attachment.getAttachmentId()%>">附件:<%=attachment.getAttachmentName()%></a></td>
- </tr>
- <%
- }
- %>
- <%}%>
- <tr>
- <td align="center">
- 审核结果:
- <input type="radio" name="a">同意
- <input type="radio" name="a">不同意
- <input type='button' value='提交审核'>
- </td>
- </tr>
- </table>
- </body>
- </html>