不同之处就是它处理的传递方法不同!当参数是通过Get方法传递时,要使用doGet()处理
当参数是通过Post方法传递时,要使用doPost()处理

解决方案 »

  1.   

    doGet 只响应画面form的method=get的请求
    doPost只响应画面form的method=post的请求
    并且get请求是明文传送的,地址栏有你提交的信息
    post请求使用数据包方式传送的在地址栏没有你提交的信息
    get提交的数据昌都有限制
    post理论上是没有限制的
      

  2.   

    这有种简单的方法:
     public void doPost(HttpServletRequest request,  HttpServletResponse response)
        throws IOException, ServletException
     {
       .............
      }
     public void doGet(HttpServletRequest request,HttpServletResponse response)
        throws IOException, ServletException
     {
         doPost(response,request);
      }这样的话,两种传递方法都能处理了! 哈哈
      

  3.   

    那还不如直接写一个service方法呢,什么请求都接受
     public void service(HttpServletRequest request,HttpServletResponse response)
        throws IOException, ServletException
     {
         
      }
      

  4.   

    还是这样的好
     public void service(HttpServletRequest request,HttpServletResponse response)
        throws IOException, ServletException
     {
         
      }