首页 > 代码库 > Eclipse在创建dynamic web时出现HTTP method GET is not supported by this URL错误

Eclipse在创建dynamic web时出现HTTP method GET is not supported by this URL错误

显然错误的原因是没有重写servlet的doGet方法,只是覆盖了doPost的方法。

解决的方法很简单:

1  public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException{2         this.doPost(req, resp);3     }