大家能否给我提供一个html的参数向servlet中传递参数的完整例子,
谢谢大家了。

解决方案 »

  1.   

    你的问题就有问题,你是想问ajax还是想问什么?
      

  2.   

    就是html里的参数呀,和ajax没有任何关系
      

  3.   

    html
    <html>
    <head>
    <body>
    <form id=frm name=frm method="post" action="test.do">
    <input type=text name=aa id=aa value="">
    <input type=submit id=bb name=bb value="submit">
    </form>
    </body>
    </head>
    </html>
    test.java
    public class test extend HttpServlet{
    public void init() throws ServletException{
    }
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws
    ServletException,IOException{
    String aa=request.getParameter("aa");
    System.out.print(aa);
    }
    public void doPost(HttpServletRequest request,HttpSerletResponse response) throws 
    ServletException,IOException{
    }
    public void destroy()
    {
    }
    }
      

  4.   

    extends 
    HttpSerletResponse ->HttpServletResponse