`
woshixushigang
  • 浏览: 575879 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类

Request method 'POST' not supported

 
阅读更多

项目采用spring mvc框架实现,插入数据时候采用

 

public BeanPropertySqlParameterSource mappingParameter(Object parameter) {
        return new BeanPropertySqlParameterSource(parameter);
    }

 

当表单不输入内容就提交(暂不考虑为空验证)就会报错:

 

org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter$ServletHandlerMethodResolver.resolveHandlerMethod(AnnotationMethodHandlerAdapter.java:654)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:431)
	at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:863)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:792)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:851)
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:767)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:438)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
	at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:421)
	at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:342)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Thread.java:680)
 
分享到:
评论

相关推荐

    java解决405 - HTTP method GET is not supported by this URL

    当您遇到"405 - HTTP method GET is not supported by this URL"这样的问题时,通常意味着您的服务器端代码没有正确处理GET请求,或者请求被误定向到了一个不期望GET方法的Servlet。 首先,我们需要理解HTTP协议中...

    spring cloud feign不支持@RequestBody+ RequestMethod.GET报错的解决方法

    在使用spring cloud feign时,我们可能会遇到org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported的报错,这是因为feign client中的RequestMethod.GET或@...

    http请求405错误方法不被允许的解决 (Method not allowed)

    主要介绍了http请求405错误方法不被允许的解决 (Method not allowed),文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧

    jsp中kindeditor的用和遇到的问题总结附上项目配置

    ${pageContext.request.contextPath}/resources/js/kindeditor-all-min.js"> ``` 3. **创建编辑器实例**:在JSP页面中,通过JavaScript创建KindEditor实例。通常会为一个特定的HTML元素(如textarea)绑定编辑器...

    详解spring cloud Feign使用中遇到的问题总结

    解决方案是,需要正确地配置 POST 请求的方法和参数,例如:@RequestMapping(value="/user/name", method=RequestMethod.POST) User createUser(@RequestBody final User user); 这篇文章总结了一些使用 Feign 时常...

    Http-servlet请求源码

    " method is not supported by this URL"; } response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, errMsg); } } ``` 当HTTP方法不被当前Servlet支持时,如`METHOD_PUT`、`METHOD_DELETE`等,`...

    Senfore_DragDrop_v4.1

    Earlier versions of Delphi and C++ Builder will not be supported. If you need Delphi 3 or C++ Builder 3 support you will have to revert to version 3.7 of the Drag and Drop Component Suite. The ...

    servlet2.4doc

    Called by the server (via the service method) to allow a servlet to handle a POST request. doPut(HttpServletRequest, HttpServletResponse) - Method in class javax.servlet.http.HttpServlet Called by ...

    Feign发送Get请求时,采用POJO对象传递参数的最终解决方案.docx

    {"timestamp":1482676142940,"status":405,"error":"MethodNotAllowed","exception":"org.springframework.web.HttpRequestMethodNotSupportedException","message":"Request method 'POST' not supported","path":...

    servlet源码解析.txt

    String msg = lStrings.getString("http.method_get_not_supported"); if (protocol.endsWith("1.1")) { resp.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED, msg); } else { resp.sendError...

    tomcat解决跨域访问问题配置

    <param-value>token,Access-Control-Allow-Origin,Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers --> <param-value>Access-Control-Allow-Origin,...

    HTTP 状态消息

    405 Method Not Allowed是请求的方法(如GET、POST)不受支持;406 Not Acceptable表示服务器无法生成客户端可接受的响应;407 Proxy Authentication Required需先通过代理服务器认证;408 Request Timeout请求超时...

    详细的Http状态参数

    - 405 Method Not Allowed:请求方法不适用于请求的资源,例如GET请求尝试PUT操作。 - 406 Not Acceptable:服务器无法提供与Accept头匹配的资源类型。 - 407 Proxy Authentication Required:客户端需要通过代理...

    Http 错误码 集合

    - `405 Method Not Allowed`:请求的方法(如GET、POST)对目标资源不适用。 - `406 Not Acceptable`:服务器无法提供满足客户端Accept头的资源。 - `407 Proxy Authentication Required`:需要通过代理服务器的...

    Web应用安全:HTTP状态码.pptx

    405 Method Not Allowed表示不支持请求的方法;406 Not Acceptable表示服务器无法生成客户端可接受的响应;407 Proxy Authentication Required要求客户端通过代理进行身份验证;408 Request Timeout表示客户端没有在...

    JSP Simple Examples

    Whenever an http client sends a request, it sends the request in the form of get or post method or any other HttpRequest methhods. It can also sends the headers with it. Specific request headers in ...

    Http协议错误码(状态消息).pdf

    405 Method Not Allowed:请求的方法(如GET、POST)不被服务器支持。 406 Not Acceptable:服务器无法根据客户端的Accept头生成可接受的响应。 407 Proxy Authentication Required:客户端需要先通过代理服务器的...

    HTTP状态码

    * 405 Method Not Allowed:表示客户端请求的方法不被服务器所允许 * 406 Not Acceptable:服务器无法提供客户端所请求的文档格式 * 407 Proxy Authentication Required:与 401 类似,但是代理服务器需要客户端提供...

    http状态码信息,详细描述了http各状态码的含义

    405(Method Not Allowed)表示请求方法(如GET、POST)不被允许。406(Not Acceptable)说明服务器无法提供满足请求的资源格式。408(Request Timeout)表示服务器等待请求超时。409(Conflict)表示请求与当前资源...

    Tomcat服务器报错对应值解析

    - **405 Method Not Allowed**: 请求行中指定的方法不被允许。 - **406 Not Acceptable**: 服务器无法根据客户端可接受的内容特性及MIME类型,返回合适的实体内容。 - **407 Proxy Authentication Required**: 与401...

Global site tag (gtag.js) - Google Analytics