getParameter()表单中的值!写在servelt里

解决方案 »

  1.   

    如果用post,程序就在servlet里写在doPost(...)里面
      

  2.   

    public void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException{
    resp.setContentType("text/html");
    String bookID = new String();
    bookID = req.getParameter( "bookID");
    ...................
    }
      

  3.   

    我是按照上面作的,但是在SERVLET里调用getParameter()得到的是NULL值!
      

  4.   

    初始页面当然是null, 只有提交过来后才能得到.
      

  5.   

    直接用request.getParameter()就可以。要不你用request.getParameterNames()获取所有form表单域名称,打出来看看有没有,然后取值。
      

  6.   

    你只用超级连接而没有对表但submit
    servlet
    是得不到值得
      

  7.   

    你还没有submit呢?要想取得form表单中的值必须submit
      

  8.   

    <a href="文件名?参数="参数值"&&参数="参数值"/>即可
      

  9.   

    <a onclick="doPostClient()">
    <script>
    function doPostClient()
    {
    var o=new ActiveXObject('Microsoft.XMLHTTP');
    o.open ('POST','servletURL',false);
    o.send('postParam1=value1&postParam2=value2...')
    window.open('',anchorOpen);
    anchorOpen.document.write (o.responseText);
    }
    </script>
      

  10.   

    谢谢个位的参预
    问题是通过JAVASCIPT解决的
    谢谢!