📄 sample6_5.jsp
字号:
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page import="com.ajaxlab.ajax.*,java.util.Collection"%>
<%
MessageService messageService = new MessageService();
Message[] messages = (Message[])messageService.getAllMessages("educhina").toArray(new Message[0]);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>Ch06--条目内容</title>
<script language="javascript">
function detail(id) {
var element = document.getElementById("message"+id);
if(element.style.display == "") element.style.display = "none";
else element.style.display = "";
}
</script>
</head>
<body>
<table width="740" cellpadding="0" cellspacing="1" border="0" bgcolor="#FFFFFF">
<thead>
<tr height="25">
<th width="40" bgcolor="#E1E1E1">编号</th>
<th width="400" bgcolor="#E1E1E1">短信标题</th>
<th width="60" bgcolor="#E1E1E1">发送者</th>
<th width="160" bgcolor="#E1E1E1">发送时间</th>
<th width="80" bgcolor="#E1E1E1">是否回复</th>
</tr>
</thead>
<tbody>
<%
for(int i=0;i<messages.length;i++) {
%>
<tr height="25" valign="top">
<td width="40" bgcolor="#E1E1E1"><%=messages[i].getId()%></td>
<td width="400" bgcolor="#E1E1E1">
<a href="javascript:detail('<%=messages[i].getId()%>')"><%=messages[i].getTitle()%></a>
<div id="message<%=messages[i].getId()%>" style="display:none"><%=messages[i].getContent()%></div>
</td>
<td width="60" bgcolor="#E1E1E1"><%=messages[i].getAuthor()%></td>
<td width="160" bgcolor="#E1E1E1"><%=messages[i].getSubmittime()%></td>
<td width="80" bgcolor="#E1E1E1" align="center"><%=messages[i].getReplay()%></td>
</tr>
<%
}
%>
</tbody>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -