📄 newscontent.jsp
字号:
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312"%>
<%@page import="po.news.*" %>
<%@page import="po.comment.*" %>
<%@page import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新闻内容页面</title>
<%
Newst news = (Newst)request.getAttribute("news");//新闻内容
ArrayList commentList = (ArrayList)request.getAttribute("commentList");//新闻评论
%>
</head>
<body>
<table border="0px" cellspacing="0" cellpadding="10" align=center width="90%" bgColor=#E4E8EF noborder>
<tr bgcolor="#76aea0">
<td nowrap="nowrap">
<a href="Index.jsp">回首页<br></a>
<center><h2>新闻标题: <%=news.getTitle() %></h2></center>
</td>
</tr>
<tr>
<td>
<center><font size="-1">
作者: <%=news.getAuthor() %>
日期: <%= news.getTime() %>
</font></center>
</td>
</tr>
<tr>
<td>
<hr width=100%>
<font size="1"><%=news.getContent() %></font>
</td>
</tr>
<tr bgcolor="#eeeeee">
<td>
<hr width=100%>
<font size="0" color="#8000ff">读者评论</font>
</td>
</tr>
<%
if(commentList.size()>0)
{
for(int i = 0; i < commentList.size(); i++)
{
Commentt comment = (Commentt)commentList.get(i);
%>
<tr bgcolor="#eeeeee">
<td>
<hr width=100%>
<font size="0">
<%=comment.getAuthor()%>评论:评论日期:<%=comment.getTime() %><br>
</font>
<font size="0">
<%=comment.getContent() %>
</font>
</td>
</tr>
<% } %>
<% } %>
<tr bgcolor="#eeeeee">
<td>
<form action="commentAdd.do" method="post">
<input type=hidden name="newsId" value=<%=news.getNewsId()%> />
<font size="0">发表新评论:</font>
<p><textarea wrap="soft" cols="60" rows="3" name="content"></textarea></p>
<font size="0">发布者:</font><input type="text" size="30" name="author"> <input type="submit" value="发表评论" name="button2"><br>
</form>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -