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

📄 test1.jsp

📁 jsp编程jsp工程项目与实践 jsp源代码
💻 JSP
字号:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,com.proreg.Mas" %>
<% request.setCharacterEncoding("gb2312"); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>察看留言</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head>
<script language="javascript">
function add(){
	window.open("Test2.jsp","masadd","toolbar=no,memubar=no,scrollbrs=no,width=450,height=250,left=300,top=180,center=yes");
}
</script>
<body>
<table width="700" height="*" border="1" align="center" cellpadding="1" cellspacing="0" bordercolordark="#ffffff"  bordercolor="#ffffff" bordercolorlight="#0066ff">
  <tr>
    <td height="27" colspan="3" align="center"><a href="#" onclick="add()">增加留言</a></td>
  </tr>
<% 
	String color="#ffffff";
	Collection coll=(Collection)request.getAttribute("msg");
	if(coll!=null&&!coll.isEmpty()){
		Iterator it=coll.iterator();
		while(it.hasNext()){
			Mas mas=(Mas)it.next();
			if(color.equals("#ffffff")){
				color="#FFCCCC";
			}else{
				color="#ffffff";
			}
%> 
  <tr bgcolor="<%=color%>">
    <td width="83" height="27" align="center">留言主题:</td>
    <td width="181" height="27" align="center"><%= mas.getTitle() %>&nbsp;</td>
    <td width="422" height="27" rowspan="3" align="left" valign="top"><%= mas.getContent() %>&nbsp;</td>
    </tr>
  <tr bgcolor="<%=color%>">
  	<td width="83" height="27" align="center">留&nbsp;言&nbsp;人:</td>
  	<td height="27" align="center"><%= mas.getName() %>&nbsp;</td>
  	</tr>
  <tr  bgcolor="<%=color%>">
    <td height="27" align="center">留言日期:</td>
    <td height="27" align="center"><%= mas.getMtime() %>&nbsp;</td>
  </tr>
<%
		}
	}else{
%>
  <tr>
    <td height="27" align="center" colspan="3">没有留言</td>
  </tr>
<%
	}
%>
</table>
</body>
</html>

⌨️ 快捷键说明

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