我给你一个例子吧,我回答过一个朋友类似的问题。

解决方案 »

  1.   

    从页面1连到2.jsp,在2.jsp中获得1中的值
    1.jsp如下:
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>New Page 1</title>
    <script language="javascript">
    <!--
    function winopen()
    {
          var x=document.vote.R1.value;
          for (i=0;i<document.vote.R1.length;i++)
          {
            if (document.vote.R1[i].checked==true)
            {
            x=document.vote.R1[i].value;
            break;
              }
          }
          window.open("2.jsp?id="+x,"","top=0,left=380,height=444,width=400,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=yes");
    }
    -->
    </script>
    </head>
    <body>
    请选择:<br>
    <form name="vote" method="post">
      <p>
      <input type="radio" value="1" name="R1">选项1
      <input type="radio" value="2" name="R1">选项2
      <input type="radio" value="3" name="R1">选项3
      <input type="radio" value="4" name="R1">选项4
      <input type="radio" value="5" name="R1" checked>选项5
      </p>
      <p>
      <input type="button" value="提交" onclick="winopen()">
      <input type="reset" value="全部重写" name="B2"></p>
    </form>
    </body>
    </html>2.jsp程序:
    2.jsp程序如下:
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <%
    String b = request.getParameter("id");
    %>
    本页是2.jsp,从1.jsp获得的值为:<%=b%>
    </body>
    </html>
      

  2.   

    谢谢谢谢谢谢您了!你太棒了!!!分全给你!