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

📄 messages.jsp

📁 基于JSP的公交查询系统,很好用的,适于学习,操作语句全在jsp页面里
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>南昌公交查询网</title>
<style type="text/css">
<!--
body {
	background-image:  url();
	margin-left: 100px;
	margin-right: 100px;
	margin-top: 0px;
	margin-bottom: 0px;
	background-color: #999999;
}
.STYLE4 {font-size: 14px}
.STYLE7 {font-weight: bold}
.style8 {color: #FF0000}
.STYLE2 {font-weight: bold}
.style11 {font-size: smaller}
.style13 {font-size: small; font-weight: bold; }
.style6 {font-size: small}
a:link {
	color: #000000;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #000000;
}
a:hover {
	text-decoration: none;
	color: #FF0000;
}
a:active {
	text-decoration: none;
	color: #FF0000;
}
-->
</style></head>

<body>
<%  String statement="";
	   ResultSet result;
	   Connection con;
	   int count=0;
	   String username[]=new String[200]; 
	   String title[]=new String[200];
	   String posttime[]=new String[200];
	
        try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
	       }
		catch(ClassNotFoundException e){}
		 
	     try{  
	      con=DriverManager.getConnection("jdbc:odbc:nbos","","");
          Statement sql=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); 
		  statement="select * from Messages order by MessageID DESC";
		  result=sql.executeQuery(statement);
		 while(result.next())
		      {
			     username[count]=result.getString("UserName");
				 title[count]=result.getString("Title");
	             posttime[count]=result.getString("PostTime");
	            
			   count++;
			  }  
	     result.close();	}	       
		       catch(Exception e)  
				{}  
					   
				 
					
		
		     
		%>

  <table width="802" height="569" border="0" bgcolor="#FFFFFF">
    <tr>
      <td height="181"><table width=800 height="179" border=0 align=center cellpadding=0 cellspacing=0 bordercolor="#FFFFFF">
        <tbody>
          <tr>
            <td height="30" colspan="7" bordercolor="#FF0000"><img src="Picture/top.files/top2004-p1.jpg" width="800" height="30"></td>
          </tr>
          <tr>
            <td height="30" colspan="7" bordercolor="#FF0000"><img src="Picture/top.files/top2004-p2.jpg" width="800" height="30"></td>
          </tr>
          <tr>
            <td height="41" colspan="7" bordercolor="#FF0000"><img src="Picture/top.files/top2004-p3.jpg" width="800" height="41"></td>
          </tr>
          <tr>
            <td height="35" colspan="7" bordercolor="#FF0000"><img src="Picture/top.files/top2004-p4.jpg" width="800" height="35"></td>
          </tr>
          <tr>
            <td width=205
          height=13   background="Picture/topbg.gif">
              <p align=left>&nbsp;&nbsp;<font style="FONT-FAMILY: Verdana" 
            color=#ffffff>
                <script language=JavaScript class=black 
             src="css/date.js"></script>
            </font></p></td>
            <td width="87" bordercolor="#FF0000" background="Picture/topbg.gif"><span class="style6">
              <div align="center" class="style6"> <a href="http://www.0951.cc/tel/" target="_blank"><strong><strong></strong></strong></a><a href="homepage.jsp" target="_self"><strong><strong>|首页</strong></strong><strong>|</strong></a></div>
              <a href="default.html" target="mainFrame"> </a><a href="http://www.0951.cc/adxx/tielu/" target="_blank">
              <div align="center" class="style13"></div>
            </a></span></td>
            <td width="105" bordercolor="#FF0000" background="Picture/topbg.gif"><span class="style6"><a href="index.jsp" target="_self">
              <div align="center" class="style13">|本站导航|</div>
            </a></span></td>
            <td width="99" bordercolor="#FF0000" background="Picture/topbg.gif"><div align="center" class="style13">|<a href="advancequery.jsp">高级搜索</a>|</div></td>
            <td width="88" bordercolor="#FF0000" background="Picture/topbg.gif"><div align="center" class="style6"><strong><strong>|<a href="news.jsp">公交新闻</a>|</strong></strong></div></td>
            <td width="103" bordercolor="#FF0000" background="Picture/topbg.gif"><div align="center" class="style6"><a href="messages.jsp" target="_self"><strong>|留言板|</strong></a></div></td>
            <td width="113" bordercolor="#FF0000" background="Picture/topbg.gif"><div align="center" class="style6"><strong><a href="login.html" target="_parent">|系统维护|</a></strong></div></td>
          </tr>
          <tr>
            <td
          height=24 colspan="3" background="Picture/l33.gif" bgcolor="#6699FF"><marquee onMouseOver="fhhg" >
              <code><strong>网内公告:欢迎访问南昌公交查询网站!</strong> </code>
            </marquee>            </td>
            <td
          height=24 colspan="4" background="Picture/l33.gif" bgcolor="#FFFFFF"><div align="right" class="style6"><span class="style11"><a href="#" class=Bottom onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://localhost:8080/nbos/homepage.jsp');">|设为首页|</a><a href="javascript:window.external.AddFavorite('http://localhost:8080/nbos/homepage.jsp','南昌公交查询网')">加入收藏|</a><a href="mailto:software_wei@163.com" class=Bottom>联系站长</a><a href="mailto:software_wei@163.com" class=Bottom>|</a></span></div></td>
          </tr>
        </tbody>
      </table></td>
    </tr>
    <tr >
      <td height="314"><div align="center">
        <table width="593" height="161" border="0">
          <tr >
            <td height="15" colspan="4" background="Picture/topbg.gif"><div align="center"><span class="STYLE2">留言板</span></div></td>
          </tr>
          <tr bgcolor="#e8f3ff">
            <td height="20" colspan="3">你好!共有<font color="#FF0000"><%=count%></font>条留言</td>
            <td width="105" height="20" background="Picture/topbg.gif" bgcolor="#e8f3ff"><div align="center" class="STYLE2"><a href="messagepost.jsp">我要留言</a></div></td>
          </tr>
          <tr bgcolor="#e8f3ff">
            <td width="76" height="17"><div align="center" class="style13">留言编号</div></td>
            <td width="237"><div align="center" class="style13">标题</div></td>
            <td width="157"><div align="center" class="style13">留言者用户名</div></td>
            <td><div align="center" class="style13">留言日期</div></td>
          </tr>
          <% for(int j=0;j<count;j++) {  %>
          <tr bgcolor="#e8f3ff">
            <td height="20"><div align="center" class="style6"><%=j+1%></div></td>
            <td height="20" bgcolor="#e8f3ff"><div align="center" class="style6"><a href="messagedetail.jsp?title=<%=title[j]%>&username=<%=username[j]%>"><%=title[j]%></a></div></td>
            <td height="20"><div align="center" class="style6"><%=username[j]%></div>
                <div align="center" class="style6"></div></td>
            <td height="20"><div align="center" class="style6"><%=posttime[j]%></div></td>
          </tr>
          <% } %>
          <tr bgcolor="#e8f3ff">
            <td height="37" colspan="4">&nbsp;</td>
          </tr>
          <tr background="Picture/bottombg.gif">
            <td height="15" colspan="4" background="Picture/topbg.gif">&nbsp;</td>
          </tr>
        </table>
      </div>
      <div align="center"></div></td>
    </tr>
    <tr >
      <td height="38" background="Picture/mainbottom.jpg">          <div align="center"></div></td>
    </tr>
    <tr background="Picture/topBar_bg.gif">
      <td height="24"><div align="center"><span class="css">Copyright &copy; 南昌公交查询网. All rights reserved 2007-2010</span></div></td>
    </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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