读书人

页面间传值的一段代码请大家帮看一下

发布时间: 2012-01-02 22:40:04 作者: rapoo

页面间传值的一段代码,请大家帮看一下

<%@ page contentType= "text/html;charset=gb2312 "%>
<html>
<body >
<TABLE width= "780 " border=0 align= "center " bgcolor= "#edf2f6 ">
<form name= "form1 " method= "post " action= "t.jsp ">
<tr>
<td>
输入原始密码
<input type= "text " name= "oldpwd " size= "6 " maxlength=6 /> </td>
<td> <input type= "image " src= "images/save.jpg "> </td>
</tr>
</form>
</TABLE>
</body>
</html>

t.jsp代码如下:
request.setCharacterEncoding( "GB2312 ");
String old=request.getParameter( "oldpaw ");
out.print(old+ "* ");

屏幕显示的是null,为何值没有传过去?

[解决办法]
String old=request.getParameter( "oldpaw ");
参数写错了(oldpaw)

读书人网 >Java Web开发

热点推荐