数据化人生奇书:急!!!提交表单后转到JSP文件后不能正常显示

来源:百度文库 编辑:中科新闻网 时间:2024/04/28 07:35:02
文件1:creditCardForm.htm

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新信用卡信息</title>
</head>

<body>
<FORM action="creditCardForm.jsp" method="post">
<p>信用卡信息</p>
<p>姓名:<input type="text" name="name" size="20"></p>
<p>信用卡号码:<input type="text" name="number" size="20"></p>
<p>信用卡类型:<select size="1" name="type">
<option>Visa</option>
<option>Master Card</option>
</select></p>
<p>出生年月:<select size="1" name="month">
<option>1</option>
<option>2</option>
<option>3</option>
</select> <select size="1" name="year">
<option>1980</option>
<option>1981</option>
<option>1982</option>
</select></p>
<p> </p>
<p><input type="submit" value="提交" name="Submit"> <input type="reset" value="重置" name="Reset">
</body>

</html>

文件2:creditCardForm.jsp

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>信用卡处理JSP</title>
</head>

<body>
信用卡处理
<UL>
<L1>姓名 = <%=request.getParameter("name")%>
<L1>号码 = <%=request.getParameter("number")%>
<L1>类型 = <%=request.getParameter("type")%>
<L1>出生年月 = <%=request.getParameter("month")%>/
<%=request.getParameter("year")%>
</UL>
</body>
</html>

为什么点击“提交”后会显示如下

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>信用卡处理JSP</title>
</head>

<body>
信用卡处理
<UL>
<L1>姓名 = <%=request.getParameter("name")%>
<L1>号码 = <%=request.getParameter("number")%>
<L1>类型 = <%=request.getParameter("type")%>
<L1>出生年月 = <%=request.getParameter("month")%>/
<%=request.getParameter("year")%>
</UL>
</body>
</html>

您好,要是不能成功,在里面就会有提示的(红色字体),那里有错误那里就有提示,例如名字错误,那在名字右边就有红色字体提示是什么原因造成的错误,只要您按照提示修改就可以啦