问题概述: 借助MyEclipse直接建立了一个Servlet类,每次访问这个Servlet都能访问。可自己建立一个Servlet为什么总提示:HTTP Status 405 - HTTP method GET is not supported by this URL。的确是继承了HttpServlet,而且是重写了它的doGet()、doPost()方法(注意这两种方法一定要写)

public class SearchServlet extends HttpServlet{
  @Override
  protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
  // TODO Auto-generated method stub
  super.doPost(req, resp);
  }
}

解决:问题出来蓝色那行代码,事实上我们是不需要去调用父类的doPost()方法,去掉就可以了!

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

  1. 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 ...

  2. 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 ...

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

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

  4. 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()方法未覆盖. 应写 ...

  5. There was an unexpected error (type=Method Not Allowed, status=405). Request method 'POST' not supported

    背景:点击提交按钮ajax请求接口时,报出错误[ Whitelabel Error Page This application has no explicit mapping for /error, ...

  6. 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 ...

  7. 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 ...

  8. HTTP method GET is not supported by this URL

    Servlet eroor:HTTP method GET is not supported by this URL 错误提示: type: Status report message: HTTP m ...

  9. HTTP Status 405 - Request method 'GET' not supported?(尚硅谷Restful案例练习关于Delete方法出现的错误)

    哈罗大家好,最近在如火如荼的学习java开发----Spring系列框架,当学习到SpringMVC,动手实践RESTFUL案例时,发现了以上报错405,get请求方法没有被支持. 首先第一步,我查看 ...

随机推荐

  1. hdu 1811 Rank of Tetris - 拓扑排序 - 并查集

    自从Lele开发了Rating系统,他的Tetris事业更是如虎添翼,不久他遍把这个游戏推向了全球. 为了更好的符合那些爱好者的喜好,Lele又想了一个新点子:他将制作一个全球Tetris高手排行榜, ...

  2. xlrd、xlwt 操作excel表格详解

    转自:https://www.cnblogs.com/jiablogs/p/9141414.html python操作excel主要用到xlrd和xlwt这两个库,即xlrd是读excel,xlwt是 ...

  3. 如何评价 React 实现的前端 UI 库 material-ui?

    作者:知乎用户链接:https://www.zhihu.com/question/51040975/answer/208582603来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请 ...

  4. How to Use GNOME Shell Extensions

    如果没有安装Tweaks请先安装,命令如下: sudo apt install gnome-tweak-tool 1. Use gnome-shell-extensions package [easi ...

  5. ZOJ 4027 Sequence Swapping(DP)题解

    题意:一串括号,每个括号代表一个值,当有相邻括号组成()时,可以交换他们两个并得到他们值的乘积,问你最大能得到多少 思路:DP题,注定想得掉头发. 显然一个左括号( 的最远交换距离由他右边的左括号的最 ...

  6. 外观模式Facade pattern

    http://www.runoob.com/design-pattern/facade-pattern.html 外观模式 外观模式(Facade Pattern)隐藏系统的复杂性,并向客户端提供了一 ...

  7. Visual studio 离线安装

    VS2017在下载好安装程序安装的时候,会根据你选择的功能模块来下载所需要的安装程序,而这些安装程序的下载位置并不会让你选择,而是直接放在 C:\ProgramData\Microsoft\Visua ...

  8. Docker、Kubenets使用前配置

    1.开发人员需要确保机器上装有Docker并准确配置了Registry,能否推送相关镜像到Registry(运维人员无此要求) 2.能够访问Kubernetes APIServer相关API, 拥有相 ...

  9. BSEG和BSIS、BSAS、BSID、BSAD、BSIK、BSAK 六个表的关系

    BSEG和BSIS.BSAS.BSID.BSAD.BSIK.BSAK六个表的关系 1.数据关系: BSAS+BSIS+BSAK+BSIK+BSAD+BSID = BSEG 2.六个表说明: clear ...

  10. javascript - 内存空间

    也许很多人像我一样,觉得JS有垃圾回收机制,内存就可以不管了,以至于在全局作用域下定义了很多变量,自以为JS会自动回收,直到最近,看了阮一峰老师,关于javascript内存泄漏的文章时,才发现自己写 ...