【0】README
1)本文旨在解决  405: HTTP method GET is not supported by this URL 的问题;
2)本文raw idea is checkouted from  http://stackoverflow.com/questions/5370633/405-http-method-get-is-not-supported-by-this-url

【1】解决方法:一句话说完,要重写父类的 doGet 和 doPost方法,就不要调用 super.doGet() 和 super.doPost()方法;如下:
public class SampleServlet extends HttpServlet {private static final long serialVersionUID = -5404916983906926869L;/* @Overridepublic void init() throws ServletException {super.init();}*/@Overrideprotected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// super.doGet(request, response);  // should be commented outresponse.setContentType("text/plain");PrintWriter out = response.getWriter();System.out.println("console info: 请求SampleServlet GET Method");out.println("GET Method: these info are transmitted into client.");out.flush();}@Overrideprotected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// super.doPost(request, response); // should be commented outresponse.setContentType("text/plain");PrintWriter out = response.getWriter();System.out.println("请求SampleServlet GET Method");out.print("请求SampleServlet POST Method");out.flush();}/*@Overridepublic void destroy() {super.destroy();}*/
}

405: HTTP method GET is not supported by this URL相关推荐

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

    程序出现: HTTP Status 405 - HTTP method POST is not supported by this URL 发现原因如下 源程序: request.getRequest ...

  2. 关于Servlet报错:405 HTTP method GET is not supported by this URL问题解决方法

    在编写一个项目的某个Servlet时候,在运行时候,报出了错误 405 HTTP method GET is not supported by this URL,在通过查询,得到大家很多解决方法,为了 ...

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

    是因为重写doPost或doGet方法时 super.doPost(req, resp); super.doGet(req, resp); 去掉这2句话就可以了

  4. 解决HTTP method POST is not supported by this URL的问题

    在学习SpringBoot整合Servlet三大组件的过程中.我首先自定义了一个Servlet继承自HttpServlet,代码如下: @Component public class MyServle ...

  5. Android异常总结---type Status report message HTTP method GET is not supported by this URL

    2.type Status report   message HTTP method GET is not supported by this URL   description The specif ...

  6. HTTP Status 405 – Method Not Allowed HTTP method GET is not supported by this URL

    如图 出现这个错误的原因是Servlet中doGet和doPost的问题导致的,要将调用父类方法的super删除.还有doPost中要调用doGet方法.

  7. springmvc:405 request method post not supported

    $.ajax({type: "POST",url: "../userKvtableAll/bindOpt",data: "id="+id,d ...

  8. springMVC出现HTTP Status 405 - Request method 'GET' not supported错误的解决方法

    今天在写一个简单的springMVC的表单请求处理时,出现了这个问题.我的form表单用的是post方法提交,并没有使用get方法,出现这个问题时,笔者可谓是一脸懵逼. 这是form表单: 这是对po ...

  9. Restful风格,PUT修改功能请求,表单中存在文件报错-HTTP Status 405 - Request method 'POST' not supported...

    解决方案配置如下 <!-- 配置文件上传解析器 --><bean id="multipartResolver" class="org.springfra ...

最新文章

  1. eclipse 插件,直接打开文件路径
  2. Redis radix tree源码解析
  3. SEO优化篇 - 搜索引擎抓取href=#!锚点
  4. C#中委托和事件的区别
  5. 马化腾,你就把微信卖给运营商得了
  6. Fast上传图片成功,FastDFSweb页面显示失败
  7. 常用装机必备 绿色免安装软件合集 破解高手菜鸟必备(每日更新总有一款适合您
  8. itools苹果录屏大师_iTools Pro 1.8.0.4 简单易用的苹果设备 iPhone/iPad 管理工具
  9. WinZip 6 for Mac(压缩压解工具)附注册码 v6.5.4149破解版
  10. OpenDaylight-Boron学习笔记: 6 VTN模块
  11. 复位电路加二极管的作用
  12. MOS管做二极管使用
  13. explicit的作用
  14. onRef在react中的使用
  15. IT项目经理应具备的十大软技能
  16. IDEA通过插件安装Gitee并clone项目
  17. 2019年第四届天梯赛 CCCC 赛后总结(写一下)
  18. 人工智能之深度学习常见应用方向你都了解吗?(文末包邮送书5本)
  19. ORA-01031: insufficient privileges报错如何处理
  20. 拉噗拉司金字塔LaplacianPyramid学习笔记(一半章子怡 + 一半孙俪)

热门文章

  1. LOJ#2145. 「SHOI2017」分手是祝愿
  2. Acwing202. 最幸运的数字
  3. Acwing 232. 守卫者的挑战
  4. 1147 Heaps
  5. 2021 NOI游记
  6. YbtOJ#662-交通运输【线段树合并,树状数组】
  7. P5431-[模板]乘法逆元2【递推】
  8. P1236-Network of Schools(学校网络)【最强联通块,Kosaraju】
  9. 【AC自动机】前缀匹配(ybtoj AC自动机-3)
  10. 「LibreOJ NOIP Round #1」旅游路线