这里有一组小程序,是关于用request.getParameter()得到表单参数的例子,在name里输入中文名后返回的参数是“????”,我把程序贴出来,大侠帮忙改一下(最好是把修改后完整的例子贴出来,这样我好理解些)谢谢拉
文件名字是requestandform.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" 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>用内置对象request来处理表单</title>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
width:200px;
height:115px;
z-index:1;
}
-->
</style>
</head>
<body>
<center><h2>使用内置对象rquest处理表单</h2>
<form id="form1" name="form1" method="post" action="formcanshufanhuiye.jsp">
name:
<label>
<input name="name" type="text" id="name" />
</label>
<br />
<br />
telephone:
<label>
<input name="telephone" type="text" id="telephone" />
</label>
<br />
<br />
<label>
<input type="submit" name="Submit" value="发送" />
</label>
</form>
<p> </p>
<p> </p>
</center>
</body>
</html>
文件名 formcanshufanhuiye.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" 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>使用内置对象request返回表单参数</title>
</head>
<body>
<center><h3>使用内置对象request返回表单参数</h3></center>
<table>
<tr>
<td>
<h3>Your name is: <%=request.getParameter("name")%>
</h3>
</td>
</tr>
<tr>
<td>
<h3>Your telphone number is:<%=request.getParameter("telephone")%></h3>
</td>
</tr>
</table>
</body>
</html>