Servlet eroor:HTTP method GET is not supported by this URL
错误提示:
type: Status report
message: HTTP method GET is not supported by this URL
description: The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).
原因:
1,继承自HttpServlet的Servlet没有重写对于请求和响应的处理方法:doGet或doPost等方法;默认调用父类的doGet或doPost等方法;
2,父类HttpServlet的doGet或doPost等方法覆盖了你重写的doGet或doPost等方法;
不管是1或2,父类HttpServlet的doGet或doPost等方法的默认实现是返回状态代码为405的HTTP错误表示对于指定资源的请求方法不被允许。
解决方法:
1,子类重写doGet或doPost等方法;
2,在你扩展的Servlert中重写doGet或doPost等方法来处理请求和响应时 不要调用父类HttpServlet的doGet或doPost等方法,即去掉super.doGet(request, response)和super.doPost(request, response);

谢谢@http://blog.csdn.net/qfs_v/article/details/2545168

HTTP method GET is not supported by this URL的更多相关文章

  1. 405 HTTP method GET is not supported by this URL

    孙鑫java web开发详解P285里面提交Get网站弹出提示405 HTTP method GET is not supported by this URL 原因父类doGet()方法未覆盖. 应写 ...

  2. HTTP method GET is not supported by this URL(转)

    源地址:http://blog.csdn.net/qfs_v/article/details/2545168 Servlet  eroor:HTTP method GET is not support ...

  3. doPost或doGet调用出错(状态代码为405) : HTTP method GET is not supported by this URL

    最近做servlet发现了个问题,解决办法记下来: Servlet  eroor:HTTP method GET is not supported by this URL 错误提示: type: St ...

  4. HTTP Status 405 - HTTP method GET is not supported by this URL

    问题概述: 借助MyEclipse直接建立了一个Servlet类,每次访问这个Servlet都能访问.可自己建立一个Servlet为什么总提示:HTTP Status 405 - HTTP metho ...

  5. tomcat报错HTTP Status 405 - HTTP method GET is not supported by this URL

    servlet提交表单,结果出错. 出现HTTP Status 405 - HTTP method GET is not supported by this URL 原因是:1.继承自Httpserv ...

  6. HTTP method POST is not supported by this URL

    修改提交页面的提交方式,修改method为get(在index页面中html标签 method="get") 示例代码修改后的代码: <form action="s ...

  7. jsp HTTP Status 405 - HTTP method GET is not supported by this URL

    package myservlet.control; import java.io.IOException; import java.io.PrintWriter; import javax.serv ...

  8. HTTP Status 405 - HTTP method POST is not supported by this URL

    出现这个问题, 1.在servlet中没有调用post()方法引起的 2.在serlvet中跳转没有用外跳(response.sendRedirect()) 我的是因为第一种,是没有写dopost() ...

  9. Request method 'PUT'/ 'POST' not supported

    起因 在项目中遇到需要进行crud操作的功能,用的是Springboot+MybatisPlus+MySQL+AVue,在通过postman测试接口正确性时遇到此错误. 排查过程 因为项目运行是没问题 ...

随机推荐

  1. 2019-8-15C#MDI窗体实现多窗口效果

    C#MDI窗体实现多窗口效果  Visual C#是微软公司推出的下一代主流程序开发语言,他也是一种功能十分强大的程序设计语言,正在受到越来越多的编程人员的喜欢.在Visual C#中,提供了为实现M ...

  2. 学习笔记——C++编程cin测试记录

    cin读取输入流,遇到空格会暂停,下次继续读入剩下的,+++. #include <iostream> using namespace std; int main() { cout< ...

  3. python小白之矩阵matrix笔记(updating)

    Matrix #python学习之矩阵matrix 2018.4.18 # -*- coding: UTF-8 -*- from numpy import * import numpy as np i ...

  4. 005-多线程-集合-Map-ConcurrentSkipListMap

    一.概述 ConcurrentSkipListMap是线程安全的有序的哈希表,适用于高并发的场景. ConcurrentSkipListMap和TreeMap,它们虽然都是有序的哈希表.但是,第一,它 ...

  5. 123457123457#1#-----com.threeapp.circlerunner01----儿童旋转跑酷游戏

    com.threeapp.circlerunner01----儿童旋转跑酷游戏

  6. 【Leetcode_easy】686. Repeated String Match

    problem 686. Repeated String Match solution1: 使用string类的find函数: class Solution { public: int repeate ...

  7. Docker 跨主机网络 overlay(十六)

    目录 一.跨主机网络概述 二.准备 overlay 环境 1.环境描述 2.创建 consul 3.修改 docker 配置文件 4.准备就绪 三.创建 overlay 网络 1.在 host1 中创 ...

  8. nginx之配置proxy_set_header问题梳理

    客户端请求web服务,客户端:ip:192.168.223.1 nginx作为反向代理服务器:192.168.223.136 nginx作为后端web服务器:192.168.223.137 前提条件: ...

  9. 精选实用 Chrome 扩展(20)

    ● Reading List 简介:收藏网页,稍后阅读 ● OneTab 简介:收起当前已打开的标签页,需要的时候恢复 ● IE Tab 简介:网页用IE打开 ● uBlock Origin ● Pe ...

  10. SDOI2010_大陆争霸(邻接表存图)

    题目描述 在一个遥远的世界里有两个国家:位于大陆西端的杰森国和位于大陆东端的 克里斯国.两个国家的人民分别信仰两个对立的神:杰森国信仰象征黑暗和毁灭 的神曾·布拉泽,而克里斯国信仰象征光明和永恒的神斯 ...