liuyan1.jsp
<%
String temp=new String();
temp=(String)application.getAttribute("num");
if(temp==null){
application.setAttribute("num","0");
}
%>
<html>
<head>
<title>留言板</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head><body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<p align="center"><b><font size="5" color="#FF6633">留 言 板</font></b></p>
<hr size="1">
<form name="form1" method="post" action="liuyan2.jsp">
<table width="60%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#999999">
<tr bgcolor="#FFFFFF">
<td width="20%">留言作者:</td>
<td width="80%">
<input type="text" name="txtaut">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%">留言标题:</td>
<td width="80%">
<input type="text" name="txttit">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%">留言内容:</td>
<td width="80%"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%"> </td>
<td width="80%">
<textarea name="txtart" cols="45" rows="7"></textarea>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%"> </td>
<td width="80%"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="2">
<div align="center">
<input type="submit" name="cmdok" value="添加到留言薄">
<input type="reset" name="cmdreset" value="重新填写留言">
<input type="button" name="cmdread" value="查看所有留言"
onClick="MM_openBrWindow('liuyan3.jsp'),'','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=400,height=400'">
</div>
</td>
</tr>
</table>
</form>
<p> </p>
</body>
</html>
liuyan2.jsp
<html>
<head>
<title>留言板</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head><body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<p align="center"><b><font size="5" color="#FF6633">留 言 板</font></b></p>
<hr size="1">
<%
int n;
String temp=new String();
String temp1=new String();
String temp2=new String();
String temp3=new String();
temp1=request.getParameter("txttit");
temp2=request.getParameter("txtaut");
temp3=request.getParameter("txtart");
n=temp1.length()*temp2.length()*temp3.length();
if(n!=0){
temp=(String)application.getAttribute("num");
n=Integer.parseInt(temp);
n=n+1;
temp=temp.valueOf(n);
application.setAttribute("num",temp);
application.setAttribute("tit"+temp,temp1);
application.setAttribute("aut"+temp,temp2);
application.setAttribute("art"+temp,temp3);
%>
<p> </p>
<p align="center">留言成功!</p>
<%
}
else{
%>
<p align="center"><font color="#FF0000">不添加作者、标题和内容,留言失败!</font></p>
<%
}
%>
<p align="center"><a href="liuyan1.jsp">返回首页</a> </p>
</body>
</html>
liuyan3.jsp
<html>
<head>
<title>留言板</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<p align="center"><b><font size="5" color="#FF6633">留 言 板</font></b></p>
<hr size="1">
<%
int n;
String temp=new String();
String temp1=new String();
String temp2=new String();
String temp3=new String();
temp=(String)application.getAttribute("num");
n=Integer.parseInt(temp);
if(n==0){
%>
<p> </p>
<p align="center">目前还没有文章!</p>
<%
}
else{
%>
<table width="60%" border="1" cellspacing="0" cellpadding="5" align="center" bordercolor="#999999">
<%
int i;
for(i=1;i<=n;i++){
temp=temp.valueOf(i);
temp1=(String)application.getAttribute("tit"+temp);
temp2=(String)application.getAttribute("aut"+temp);
temp3=(String)application.getAttribute("art"+temp);
%>
<tr>
<td bgcolor="#CCFFCC" height="27"><b><%=temp%>.标题:<%=temp1%>作者:<%=temp2%></b></td>
</tr>
<tr>
<td><%=temp3%></td>
</tr>
<%
}
}
%>
</table>
<p align="center"> </p>
</body>
</html>
<%
String temp=new String();
temp=(String)application.getAttribute("num");
if(temp==null){
application.setAttribute("num","0");
}
%>
<html>
<head>
<title>留言板</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head><body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<p align="center"><b><font size="5" color="#FF6633">留 言 板</font></b></p>
<hr size="1">
<form name="form1" method="post" action="liuyan2.jsp">
<table width="60%" border="0" cellspacing="1" cellpadding="3" align="center" bgcolor="#999999">
<tr bgcolor="#FFFFFF">
<td width="20%">留言作者:</td>
<td width="80%">
<input type="text" name="txtaut">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%">留言标题:</td>
<td width="80%">
<input type="text" name="txttit">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%">留言内容:</td>
<td width="80%"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%"> </td>
<td width="80%">
<textarea name="txtart" cols="45" rows="7"></textarea>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="20%"> </td>
<td width="80%"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="2">
<div align="center">
<input type="submit" name="cmdok" value="添加到留言薄">
<input type="reset" name="cmdreset" value="重新填写留言">
<input type="button" name="cmdread" value="查看所有留言"
onClick="MM_openBrWindow('liuyan3.jsp'),'','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,width=400,height=400'">
</div>
</td>
</tr>
</table>
</form>
<p> </p>
</body>
</html>
liuyan2.jsp
<html>
<head>
<title>留言板</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head><body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<p align="center"><b><font size="5" color="#FF6633">留 言 板</font></b></p>
<hr size="1">
<%
int n;
String temp=new String();
String temp1=new String();
String temp2=new String();
String temp3=new String();
temp1=request.getParameter("txttit");
temp2=request.getParameter("txtaut");
temp3=request.getParameter("txtart");
n=temp1.length()*temp2.length()*temp3.length();
if(n!=0){
temp=(String)application.getAttribute("num");
n=Integer.parseInt(temp);
n=n+1;
temp=temp.valueOf(n);
application.setAttribute("num",temp);
application.setAttribute("tit"+temp,temp1);
application.setAttribute("aut"+temp,temp2);
application.setAttribute("art"+temp,temp3);
%>
<p> </p>
<p align="center">留言成功!</p>
<%
}
else{
%>
<p align="center"><font color="#FF0000">不添加作者、标题和内容,留言失败!</font></p>
<%
}
%>
<p align="center"><a href="liuyan1.jsp">返回首页</a> </p>
</body>
</html>
liuyan3.jsp
<html>
<head>
<title>留言板</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head><body bgcolor="#FFFFFF" text="#000000">
<p> </p>
<p align="center"><b><font size="5" color="#FF6633">留 言 板</font></b></p>
<hr size="1">
<%
int n;
String temp=new String();
String temp1=new String();
String temp2=new String();
String temp3=new String();
temp=(String)application.getAttribute("num");
n=Integer.parseInt(temp);
if(n==0){
%>
<p> </p>
<p align="center">目前还没有文章!</p>
<%
}
else{
%>
<table width="60%" border="1" cellspacing="0" cellpadding="5" align="center" bordercolor="#999999">
<%
int i;
for(i=1;i<=n;i++){
temp=temp.valueOf(i);
temp1=(String)application.getAttribute("tit"+temp);
temp2=(String)application.getAttribute("aut"+temp);
temp3=(String)application.getAttribute("art"+temp);
%>
<tr>
<td bgcolor="#CCFFCC" height="27"><b><%=temp%>.标题:<%=temp1%>作者:<%=temp2%></b></td>
</tr>
<tr>
<td><%=temp3%></td>
</tr>
<%
}
}
%>
</table>
<p align="center"> </p>
</body>
</html>
解决方案 »
- 这个页面咋总有问题
- xmlDoc.getElementsByTagName获得值为空,怎么回事?
- 百思不得其解,,,,这个问题一直困扰着我。。。。。。
- 200分求Jfreechart相关软件包,Jfreechart1.03 和相关的doc文档,差不多是官方下载的那三个文件就可以,谢谢了,
- 将页面表格保存为EXCEL文件,如何解决中文乱码问题?
- 如何用JAVA读INI文件
- 请问JavaScript树形菜单实现的原理是什么?
- struts2.0资源共享
- 请教大家怎么用chartdirector在同一个jsp页面画出多个统计图
- tomcat 4.1如何启动?
- resin与tomcat哪个更好一点?
- 如何实现ASP中类似Global.asa的功能???
application.setAttribute("name","value");
%>
<%
String s = (String)application.getAttribute("name");
%>
只需要人民币20元,你就可以获得本灌水机的程序和Visual C++源代码,并获得永久性技术支持。还等什么?灌水等着你!就在今夜!元宵佳节!(可怜我信誉)