<%@ page import="java.sql.*,com.jspdev.ch9.*,java.util.*,java.sql.*"%>
<jsp:useBean id="messageBean" class="com.jspdev.ch9.MessageBean" scope="page"/>
<HTML>
<HEAD>
<TITLE> show the message in the table </TITLE>
</HEAD>
<LINK href="..\..\hellking.css" type=text/css rel=stylesheet>
<BODY>
<p align="center">所有访客留言</p>
<hr>
<%
int message_count=0;
Collection messages=messageBean.getMessage();
Iterator it=messages.iterator();
while(it.hasNext())
{
   MessageVO message=(MessageVO)it.next();   
%>
<TABLE  width="100%" align="center" border=1 brcolor=99ccff cellspacing="0" cellpadding="0" bordercolordark="#000000" bordercolorlight="#CCCC99">
<tr><td bgcolor="#CCCC99"><font size=2>主题：</font></td>
<td colspan=3><%=message.getTitle()%></td></tr>
<tr><td bgcolor="#CCCC99"><font size=2>留言人：</font></td>
<td><%=message.getName()%></td><td bgcolor="#CCCC99"><font size=2>E-mail：</font></td>
<td>
<% 
out.println("<a href=mailto:"+message.getEmail()+">"+message.getEmail()+"</a>");
%>
</td></tr>
<tr><td bgcolor="#CCCC99"><font size=2>留言时间：</font></td><td colspan=3>
<%
out.println("<font size=2>"+message.getDate().toLocaleString()+"</font>");
%>
</td></tr>
<tr><td align="center">
<%
out.println("("+message_count+")"); 
%>
</td>
<td colspan=3><%=message.getContent()%>
</td></tr>
</table>
<%
out.println("<hr>");
message_count++;
} 
%>
<p align="center"><a href="index.html">我要留言</a></p>
</body>
</html>
