newsmodify.jsp
上传用户:junmaots
上传日期:2022-07-09
资源大小:2450k
文件大小:3k
- <%@page contentType="text/html; charset=GBK" language="java" %>
- <%@page import="com.mycompany.news.service.NewsService"%>
- <%@page import="com.mycompany.news.dto.*"%>
- <%@page import="java.text.SimpleDateFormat" %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gbk">
- <title>新增新闻信息</title>
- <script language="javascript1.2" src="../js/editor.js" type="text/javascript"></script>
- <script language="Javascript1.2">browserControl()</script>
- <link href="../css/common.css" rel="stylesheet" type="text/css">
- </head>
-
- <%
- Long id=Long.valueOf(request.getParameter("id"));
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
- NewsService service = new NewsService();
- News news = service.getByID(id.longValue());
- java.util.List attachments = service.getAttachments(id.longValue());
- %>
- <body leftmargin="40">
- <form name="form1" action='<%=request.getContextPath()%>/servlet/ModifyNews' method="post" enctype="multipart/form-data" >
- <input type="hidden" name='columnId' value="<%=news.getColumnId()%>">
- <input type="hidden" name='newsId' value="<%=news.getNewsId()%>">
- <table align="left" border=0 width="90%">
- <tr>
- <td colspan="4" align="center"><b>编辑新闻</b></td>
- </tr>
- <tr>
- <td width="90" align='right'>新闻标题</td>
- <td width="350"><input type="text" name ='subject' style="width:100%" value='<%=news.getSubject()%>'> </td>
- <td width="150" align='right'>新闻显示时间</td>
- <td><input name='showTime' value="<%=news.getShowTime()!=null?sdf.format(news.getShowTime()):""%>"></td>
- </tr>
- <tr>
- <td colspan='4' align="center">
- <textarea name="content" style="width:100%; height:80"><%=news.getContent()%></textarea>
- </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>发布人</td>
- <td><input name="author" value='<%=news.getAuthor()%>'></td>
- <td>是否更新附件</td>
- <td><input type="radio" name="updateattr" value="y">是<input type="radio" name="updateattr" value="n" checked>否</td>
- </tr>
- <tr>
- <td>新附件1</td>
- <td><input type='file' name='file'></td>
- <td>新附件2</td>
- <td><input type='file' name='file'></td>
- </tr>
- <tr>
- <td colspan=4 align='center'><input type='submit' value='提交'></td>
-
- </tr>
- </table>
- </form>
- </body>
- </html>
- <script language="javascript1.2">newConfig('content')</script>