首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

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

2012-01-02 
页面间传值的一段代码,请大家帮看一下%@pagecontentType text/htmlcharsetgb2312 %htmlbodyTA

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

<%@   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)

热点排行