1、错误信息:HTTP method GET is not supported by this URL
2、字面理解:Get方法不能为URL请求的支撑工作
3、解决方案:查看该功能对应的servlet类,是否重写了doGet()、doPost()方法,并使用doGet()方法完成servlet中功能的实现及函数的调用操作。如果重写了doGet()、doPost()方法,记得删除自动生成的super.doGet(req, resp)和super.doPost(req, resp)
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//super.doGet(req, resp);
System.out.println("这里是get请求");
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//super.doPost(req, resp);
System.out.println("这里是post请求");
}