405: HTTP method GET is not supported by this URL
来源:互联网 发布:数据库用户是什么 编辑:程序博客网 时间:2024/06/06 02:59
【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; /* @Override public void init() throws ServletException { super.init(); }*/ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // super.doGet(request, response); // should be commented out response.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(); } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // super.doPost(request, response); // should be commented out response.setContentType("text/plain"); PrintWriter out = response.getWriter(); System.out.println("请求SampleServlet GET Method"); out.print("请求SampleServlet POST Method"); out.flush(); } /*@Override public void destroy() { super.destroy(); }*/}
0 0
- 405 HTTP method GET is not supported by this URL
- 405: HTTP method GET is not supported by this URL
- 405--HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL 问题解决
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- Servelet:HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- HTTP method GET is not supported by this URL
- cocos2d-x 3.x学习之声音系统
- JAVA 复制文件夹(含子目录)
- SGU 311. Ice-cream Tycoon(平衡树)
- 欢迎使用CSDN-markdown编辑器
- This cache store does not support tagging
- 405: HTTP method GET is not supported by this URL
- 个人总结之基于MSP430F5510的X9331驱动
- C++中的类型转换static_cast、dynamic_cast、const_cast和reinterpret_cast总结
- 程序中减少使用 if 语句的策略
- RecyclerView基本用法
- java 解压文件
- mysql的普通索引,唯一索引,主索引
- JQuery的一些有用的小方法
- 自定义流式布局