java吧 关注:1,295,170贴子:12,831,033
  • 2回复贴,共1

HTTP method GET is not supported by this URL问题

只看楼主收藏回复

package com.test;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
/*
*通过继承HttpServletl类开发servlet程序
*/
public class HelloHttp extends HttpServlet{
/*
*重写doget或dopost方法方法即可
*/
public void doGet(ServletRequest req,ServletResponse res)throws ServletException,IOException{
//返回hello,word!generic
System.out.println("Hello,word! http");
PrintWriter pw=res.getWriter();
pw.println("hello,word!http");
}
public void doPost(ServletRequest req,ServletResponse res)throws ServletException,IOException{
this.doGet(req,res);
}
}


1楼2011-10-24 14:16回复
    该问题已经得到解决 谢谢大家!
    doGet和doPost里的参数不对。。。


    2楼2011-10-24 17:10
    回复
      2026-01-19 22:27:57
      广告
      不感兴趣
      开通SVIP免广告
      lZ,时隔3年,我也遇到了类似问题,请问你当时是怎么解决的?


      3楼2014-06-10 22:55
      回复