Jsp2.jsp?Code=1&Name=Jack
不需要两个&window.open("Jsp2.jsp?Code="+Code1+"&Name="+Name1,"");
多了个+号<input type="text" name="Name" size="60"  value="<%=request.getParameter("Name")%>">
jsp2没有显示request.getParameter

解决方案 »

  1.   

    <td align="left" width="80%" class="FontUnderLine" onclick="Edit('2','Rose')">Rose</td>
      

  2.   

    Edit('2','Rose')
    调用的时候使用引号让他成为字符串
      

  3.   

    改过以后的程序如下:用JAVASCRIPT的还是没有反映。WHY?
    <html>
    <head>
    <title>
    Jsp1
    </title>
    <style  type="text/css">
    .FontUnderLine { text-decoration: underline}
    </style>
    <script language=javascript>
    function  Edit(code, name){
      var Code1 = code;
      var Name1 = name;
       window.open("Jsp2.jsp?Code="+Code1+"&Name="+Name1,"");
    }
    </script>
    </head>
    <body>
    <table border="1">
    </table>
    <form name="form1" method="post" action="Jsp2.jsp" >
    <table  border="1" width="80%"   >
       <table border="1" width="80%" >
       <tr bgcolor ="yellow">
        <td width="16%">
        <div align="center">Code</div>
        </td>    <td width="80%">
          <div align="left">Name</div>
        </td>  </tr>
      <tr border="1"  width="100%"  cellpadding="0" cellspacing="0" >
        <td align="center" width="20%">1</td>
        <td align="left" width="80%" class="FontUnderLine"><a href="Jsp2.jsp?Code=1&Name=Jack">Jack</a> </td>
      </tr>
      <tr>
        <td align="center" width="20%">2</td>
        <td align="left" width="80%" class="FontUnderLine" onclick="Edit('2','Rose')">Rose</td>
      </tr>
     </table>
    </table>
    </form>
    </body>
    </html>JSP2:
    <html>
    <head>
    <title></title>
    <SCRIPT language=javascript >
    </SCRIPT>
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <form name="form1" action="Jsp2.jsp" method="post">
    <table border="1" width="80%" cellspacing="0" cellpadding="0">
      <tr>
        <td>
         <table width="80%" border="0" cellspacing="0" cellpadding="0">
            <tr class="DrakRedTr">
              <td colspan="10" class="WhiteBold">Description</td>
            </tr>
        </table>
        </td>
      </tr>
      <tr>
        <td height="2">
          <table width="100%" border="0" cellspacing="0" cellpadding="0" height="8">
            <tr>
              <td width="5%" height="2">
                <input type="submit" name="Save" value="save"   onclick=" sub(this.form,save)">
              </td>
              <td width="62%" height="2">
                <input type="button" name="button" value="Abort"  onclick="abort(this.form)">
              </td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td>
         <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td nowrap width="18%">
                <div align="right">Code:</div>
              </td>
              <td width="82%">
                <input type="text" name="Code" size="10"  value="<%=request.getParameter("Code")%> ">
              </td>
            </tr>
            <tr>
              <td width="18%">
                <div align="right">Name:</div>
              </td>
              <td width="82%">
                <input type="text" name="Name" size="60"  value="<%=request.getParameter("Name")%>">          </td>
            </tr>
          </table>
        </td>
      </tr>
    </table>
    </form>
    </body>
    </html>
      

  4.   

    不应该的:看看下面
    <html>
    <head>
    <title>
    Jsp1
    </title>
    <style  type="text/css">
    .FontUnderLine { text-decoration: underline}
    </style>
    <script language=javascript>
    function Edit(code, name){
      var Code1 = code;
      var Name1 = name;
      var str = "Jsp2.jsp?Code="+Code1+"&Name="+Name1
      alert(str)
      window.open(str,"");
    }
    </script>
    </head>
    <body>
    <table border="1">
    </table>
    <form name="form1" method="post" action="Jsp2.jsp" >
    <table  border="1" width="80%"   >
       <table border="1" width="80%" >
       <tr bgcolor ="yellow">
        <td width="16%">
        <div align="center">Code</div>
        </td>    <td width="80%">
          <div align="left">Name</div>
        </td>  </tr>
      <tr border="1"  width="100%"  cellpadding="0" cellspacing="0" >
        <td align="center" width="20%">1</td>
        <td align="left" width="80%" class="FontUnderLine"><a href="Jsp2.jsp?Code=1&Name=Jack">Jack</a> </td>
      </tr>
      <tr>
        <td align="center" width="20%">2</td>
        <td align="left" width="80%" class="FontUnderLine" onclick="Edit('2','Rose')">Rose</td>
      </tr>
     </table>
    </table>
    </form>
    </body>
    </html>
      

  5.   

    TO: 楼上的两位用这个方法可以证明JSP2中是得到了参数,可就是定在JSP1的页面不动了,无法进入JSP2的页面,也没提示出错。
    你运行的可以进入JSP2的页面吗?
      

  6.   

    window.open(str,"");
    -->
    location.replace(str)
      

  7.   

    测试没问题,可以打开jsp2.jsp?id....p.s.你是不是在本地运行的
    需要走http://协议访问