news.jsp
来自「是我编写的一个网络购物系统。适合初学者拿去分析」· JSP 代码 · 共 52 行
JSP
52 行
<%@ page contentType="text/html;charset=GBK" language="java" import="java.sql.*,java.util.*" errorPage="" %>
<html>
<%@ include file="top.jsp"%>
<link href="css.css" rel="stylesheet" type="text/css">
<div align="center">
<center>
<table width="760" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" >
<!--DWLayoutTable-->
<%
String str=request.getParameter("news_id");
if(str==""){str="1";}
int news_id=Cint(str);
sql="select * from news where news_id="+news_id;
rs=mdb.executeQuery(sql);
if (rs.next())
{%>
<tr>
<td width="760" height="25" valign="top" ><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="760" height="25" valign="top" ><div align="center"><A href="allnews.asp">新闻中心</A>>><%=rs.getString("news_title")%></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="200" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="760" height="200" valign="top"><div align="center">日期:<%=rs.getDate("news_date")%></div>
<div align="center">
<div align="left">
<pre><%=rs.getString("news_content")%></pre>
</div>
</div></td>
</tr>
</table></td>
</tr>
</table>
</center>
</div>
<%}
else{
out.print("此新闻不存在或已经被删除!");
}
%>
<%@ include file="copy.jsp"%>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?