日期:2014-05-17  浏览次数:20948 次

jsp网页中的错误!各位帮帮忙!
这个留言版的设计,各位看看哪里错了。帮帮忙了!
/*message.jsp*/

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %><%@ page import="java.unit.*"%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>留言板</title>
</head>

<body>
<form id="form1" name="form1" method="post" action="messagePane.jsp">
  <label>
  输入你的姓名:<input type="text" name="peopleName" />
  <br />
  输入你的留言:<br />
  <textarea name="textarea" rows="10" col="36"wrap="physical"></textarea>
  <br />
  <input type="submit" name="Submit" value="提交留言" />
  <br />
  </label>
</form>
<form id="form2" name="form2" method="post" action="showMessage.jsp">
  <label>
  <input type="submit" name="look" value="查看" />
  </label>
</form>
</body>

</html>

/*messagePane.jsp*/
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.unit.*" errorPage="" %>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>处理界面</title>
</head>

<body>
<%
Vector n=(Vector)application.getAttribute("name");
Vector m=(Vector)application.getAttribute("mess");
String name=request.getParameter("peopleName");
String mess=request.getParameter("message");
if(name==null)
{
  name="guest"+(int)(Math.random()*10000);
}
if(mess==null)
{
  mess="无信息!";
}
n.add(name);
m.add(mess);
application.setAttribute("name",n);
application.setAttribute("mess",m);
out.print("你的信息已提交!");
%>
<a href="message.jsp">返回</a>
</body>
</html>

/*showMessage.jsp*/
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*,java.unit.*" errorPage="" %><%@ page import="java.unit.*"%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>查看留言</title>
</head>
<%
Vector n=(Vector)application.getAttribute("name");
Vector m=(Vector)application.getAttribute("mess");
int s=n.size;
out.print(s);
out.print("<table border=2>")
out.print("<tr>"