⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 a0ac8cb5f22f001e1dbafb2c54965caa

📁 用jsp实现在线留言!采用MVC三层架构!
💻
字号:
<%@page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="err.jsp" %>




<html><script language="JavaScript"></script></html>
<html>
<head>
<META NAME="keywords" CONTENT="溢洋 溢洋论坛 xyworker@163.com java forum jsp forum">
<META NAME="description" CONTENT="溢洋 溢洋论坛 xyworker@163.com java forum jsp forum">
<link rel='stylesheet' type='text/css' href='inc/FORUM.CSS'>
<script language="JavaScript">
function Popup(url, window_name, window_width, window_height)
{ settings=
"toolbar=no,location=no,directories=no,"+
"status=no,menubar=no,scrollbars=yes,"+
"resizable=yes,width="+window_width+",height="+window_height;

NewWindow=window.open(url,window_name,settings); }

function icon(theicon) {
document.input.message.value += " "+theicon;
document.input.message.focus();
}
</script>

<title>溢洋论坛</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body text="#0000ff" >

<jsp:include page="inc/public.jsp" flush="true"/>

<table width="760" cellspacing="0" cellpadding="0" align="center">
<jsp:useBean id="yy" scope="page" class="yy.jdbc"/>
<%! String Forum_Name,Forum_Mastor,Forum_Id;%>
<%
 String fid=request.getParameter("fid");
 Connection con=yy.getConn();
 Statement  stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
 ResultSet rs=null;
 String sql="Select 论坛id,论坛名称,版主姓名 from 论坛栏目 Where 论坛id="+fid;
 rs=stmt.executeQuery(sql);
 //out.println(sql);
 while (rs.next())
 {
   Forum_Name=rs.getString("论坛名称");
   Forum_Id=rs.getString("论坛id");
   Forum_Mastor=rs.getString("版主姓名");
 }
 //  stmt.close();
%>

<tr>
    <td bgcolor="#ffffff"  align="left"><a href="default1.jsp">首页</a>&gt;&gt;<a href="index.jsp">溢洋论坛</a>&gt;&gt;<%=Forum_Name%></td>
    <td bgcolor="#ffffff" class="post" align="left" width="330">论坛版主:<%=Forum_Mastor%>&nbsp;&nbsp;&nbsp;<a href="post.jsp?fid=<%=Forum_Id%>"><img src="IMAGES/TOPIC.GIF" border="0" ></a></td>
  </tr></table>

<table cellspacing="0" cellpadding="0" border="0" width="754" >
<tr><td bgcolor="#009ACE">

      <table border="0" cellspacing="1" cellpadding="6" width="100%" height="58">




    <tr bgcolor="#9CCFFF">
          <td width="4%" height="14">&nbsp;</td>
          <td width="30%" height="14" bgcolor="#9CCFFF">文章标题</td>
          <td width="8%" align="center" height="14">新窗</td>
          <td width="10%" align="center" height="14" bgcolor="#9CCFFF">作者</td>
          <td width="10%" align="center" height="14">回复数量</td>
          <td width="10%" align="center" height="14">浏览数量</td>
          <td width="25%" align="center" height="14">最后回复</td>
     </tr>
<%! String Note_Id,Note_Name,Replay_Name,Note_Author,Replay_Time;%>
 <%
  int PageSize=10;
  int RecordCount=0;
  int PageCount=0;
  int ShowPage=1;


  sql="Select * from 贴子 Where 版块id="+fid+" And 回复id=0  order by 贴子id desc";
  // Statement  stmt=con.createStatement();
  rs=stmt.executeQuery(sql);

  rs.last();
  RecordCount=rs.getRow();
  PageCount=(RecordCount % PageSize==0)?(RecordCount/PageSize):(RecordCount/PageSize+1);
  String Page=request.getParameter("page");
  if (Page!=null)
  {
        ShowPage=Integer.parseInt(Page);
     if (ShowPage>PageCount)
        ShowPage=PageCount;
     else if(ShowPage<0)
        ShowPage=1;
  }else
        ShowPage=1;

if (RecordCount>0)
{
rs.absolute((ShowPage-1)*PageSize+1);
for (int i=1;i<PageSize;i++)
{
  Note_Id=rs.getString("贴子id");
  Note_Name=rs.getString("贴子名称");
  Note_Author=rs.getString("贴子作者");
  Replay_Name=rs.getString("回复用户");
  Replay_Time=rs.getString("回复时间");
%>
         <tr bgcolor="#F7FBFF">
          <td align="center" height="16"><img src="IMAGES/<%=rs.getString("贴子图片")%>.GIF" ></td>
          <td height="16" bgcolor="#F7FBFF"><a href="shownote.jsp?fid=<%=Forum_Id%>&noteid=<%=Note_Id%>"><%=Note_Name%></a>
            &nbsp; </td>
          <td align="center" height="16"><a href="shownote.jsp?fid=<%=Forum_Id%>&noteid=<%=Note_Id%>" target="_blank"><img src="image/newwin.gif" border="0"></a></td>
          <td align="center" height="16"><a href="member.jsp?member=<%=Note_Author%>"><%=Note_Author%></a></td>
          <td align="center" height="16"><%=rs.getString("回复次数")%></td>
          <td align="center" height="16"><%=rs.getString("点击次数")%></td>
          <td height="16">时间:<%=Replay_Time.substring(0,16)%><br />
            作者: <a href="member.jsp?member=<%=Replay_Name%>"><%=Replay_Name%></a></td>
</tr>
<%
if (!rs.next())
break;
}
}
else
{

%>
        <tr bgcolor="#F7FBFF">
          <td align="center"  height="16" colspan="7" width="633">对不起,该论坛暂时没有贴子 </td>
        </tr>
<%
}
%>


</table>
</td></tr>
</table>
<br>
<table width="733" cellspacing="0" cellpadding="0"  height="2">
  <tr>
    <td  height="2" valign="top">&nbsp; </td>
<td  align="right" width="205" height="2">
<form method="POST" action="board.jsp">
<p><input type="hidden" name="fid" size="20" value='<%=Forum_Id%>'></p>
<p>现在是第 <font color=black ><%=ShowPage%></font> 页 转到<select size="1" name="page">
<%
for (int i=1;i<=PageCount;i++)
{
    out.println(" <option value="+i+">"+i+"页</option>");
}
%>
</select>
<input type="submit" value="go" name="B1"></p>
</form>
</td></tr>
<jsp:include page="inc/jumpboard.jsp" flush="true"/>

</table>


</body></html>

<html><script language="JavaScript"></script></html>
<jsp:include page="inc/online.jsp" flush="true"/>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -